Microsoft 365 中用于设置 Office 应用、兑换产品密钥和激活许可证的过程。
Hi,
Try this command in VBA:
Sub requestFileAccess()
'Declare Variables
Dim fileAccessGranted As Boolean
Dim filePermissionCandidates
'Create an array with file paths for the permissions that are needed.
filePermissionCandidates = Array("/Users/YourUsername/Desktop/FolderName/test1.txt", _
"/Users/YourUsername/Desktop/FolderName/test2.txt", _
"/Users/YourUsername/Desktop/FolderName/test3.txt")
'Request access from user.
fileAccessGranted = GrantAccessToMultipleFiles(filePermissionCandidates)
'Returns true if access is granted; otherwise, false.
If fileAccessGranted Then
MsgBox "Access granted to all files."
Else
MsgBox "Access denied to one or more files."
End If
End Sub