Mac API

Microsoft 並未正式支援 API, 但通過一些研究,可以線上找到更多宣告

Office 2016 for Mac 是沙盒

與支援 VBA 的其他 Office 應用程式版本不同,Office 2016 for Mac 應用程式是沙盒式的。

沙盒限制應用程式訪問應用程式容器外部的資源。這會影響涉及跨程序的檔案訪問或通訊的任何載入項或巨集。你可以使用以下部分中描述的新命令最小化沙盒的影響。Office 2016 for Mac 的新 VBA 命令

以下 VBA 命令是 Office 2016 for Mac 的新增功能。

命令 用來
GrantAccessToMultipleFiles 請求使用者一次訪問多個檔案的許可權
AppleScriptTask 從 VB 呼叫外部 AppleScript 指令碼
MAC_OFFICE_VERSION 編譯時不同 Mac Office 版本之間的 IFDEF

Office 2011 for Mac

Private Declare Function system Lib "libc.dylib" (ByVal command As String) As Long
Private Declare Function popen Lib "libc.dylib" (ByVal command As String, ByVal mode As String) As Long
Private Declare Function pclose Lib "libc.dylib" (ByVal file As Long) As Long
Private Declare Function fread Lib "libc.dylib" (ByVal outStr As String, ByVal size As Long, ByVal items As Long, ByVal stream As Long) As Long
Private Declare Function feof Lib "libc.dylib" (ByVal file As Long) As Long

Office 2016 for Mac

Private Declare PtrSafe Function popen Lib "libc.dylib" (ByVal command As String, ByVal mode As String) As LongPtr
Private Declare PtrSafe Function pclose Lib "libc.dylib" (ByVal file As LongPtr) As Long
Private Declare PtrSafe Function fread Lib "libc.dylib" (ByVal outStr As String, ByVal size As LongPtr, ByVal items As LongPtr, ByVal stream As LongPtr) As Long
Private Declare PtrSafe Function feof Lib "libc.dylib" (ByVal file As LongPtr) As LongPtr