Mac 版 OfficeOffice for Mac

使用您為使用 Office for Mac 的 Office for Windows 開發的 VBA 增益集和宏。Use VBA add-ins and macros that you developed for Office for Windows with Office for Mac.

適用于: Excel for Mac |Mac 版 PowerPoint |Word for Mac |Mac 版 Office 2016Applies to: Excel for Mac | PowerPoint for Mac | Word for Mac | Office 2016 for Mac

如果您正在撰寫 Mac 版 Office 的宏,您可以使用 VBA for Office 中所提供的大部分相同的物件。If you are authoring Macros for Office for Mac, you can use most of the same objects that are available in VBA for Office. 如需 VBA for Excel、PowerPoint 及 Word 的詳細資訊,請參閱下列各項:For information about VBA for Excel, PowerPoint, and Word, see the following:

注意

Outlook for mac 和 OneNote for Mac 不支援 VBA。Outlook for Mac and OneNote for Mac do not support VBA.

Office 2016 for Mac 已沙箱化Office 2016 for Mac is sandboxed

與其他支援 VBA 的 Office 應用程式版本不同,Office 2016 for Mac 應用程式已沙箱化。Unlike other versions of Office apps that support VBA, Office 2016 for Mac apps are sandboxed.

沙箱會限制應用程式存取應用程式容器以外的資源。Sandboxing restricts the apps from accessing resources outside the app container. 這會影響任何涉及檔案存取或跨進程通訊的增益集或宏。This affects any add-ins or macros that involve file access or communication across processes. 您可以使用下一節所述的新命令,將沙箱效果降至最低。You can minimize the effects of sandboxing by using the new commands described in the following section.

建立安裝程式或放置使用者內容Creating an installer or putting user content

如需建立增益集安裝程式的指示,請參閱以下文章: Nstalling Office 2016 For Mac 中的使用者內容For instructions on creating an installer for your add-in, please refer to the article here: nstalling User Content in Office 2016 for Mac

適用于 Mac 的 Office 2016 的新 VBA 命令New VBA commands for Office 2016 for Mac

下列 VBA 命令是 Office 2016 for Mac 的新的和唯一的。The following VBA commands are new and unique to Office 2016 for Mac.

命令Command 用於Use to
GrantAccessToMultipleFilesGrantAccessToMultipleFiles 要求使用者的許可權以立即存取多個檔案。Request a user's permission to access multiple files at once.
AppleScriptTaskAppleScriptTask 從 VB 呼叫外部 AppleScript 腳本。Call external AppleScript scripts from VB.
MAC_OFFICE_VERSIONMAC_OFFICE_VERSION 在編譯時間的不同 Mac Office 版本之間的 IFDEF。IFDEF between different Mac Office versions at compile time.

Mac 版 Office 中的功能區自訂Ribbon customization in Office for Mac

適用于 Mac 的 Office 2016 支援使用功能區 XML 的功能區自訂。Office 2016 for Mac supports ribbon customization using Ribbon XML. 請注意,Office 2016 for Mac 和 Office for Windows 中的功能區支援有一些差異。Note that there are some differences in ribbon support in Office 2016 for Mac and Office for Windows.

功能區自訂功能Ribbon customization feature Office for WindowsOffice for Windows Mac 版 OfficeOffice for Mac
使用功能區 XML 自訂功能區的能力Ability to customize the ribbon using Ribbon XML 可以使用Available 可以使用Available
支援以檔為基礎的增益集Support for document based add-ins 可以使用Available 可以使用Available
使用自訂功能區控制項叫用宏的能力Ability to invoke Macros using custom ribbon controls 可以使用Available 可以使用Available
自訂的自訂功能表Customization of custom menus 可以使用Available 可以使用Available
在自訂功能區索引標籤內加入及呼叫 Office 熟知控制項的功能Ability to include and invoke Office Fluent Controls within a custom ribbon tab 可以使用Available 最熟悉的 Office 熟知控制項識別碼與 Office for Mac 相容。Most familiar Office Fluent Control Identifiers are compatible with Office for Mac. 有些可能無法使用。Some might not be available. 針對相容 Mac 版 Office 2016 的命令,請參閱idMSOs 與 office 2016 For mac相容。For commands that are compatible with Office 2016 for Mac, see idMSOs compatible with Office 2016 for Mac.
支援使用自訂功能區控制項的 COM 增益集Support for COM add-ins that use custom ribbon controls 可以使用Available Office 2016 for Mac 不支援協力廠商的 COM 增益集。Office 2016 for Mac doesn't support third-party COM add-ins.

與適用于 Mac 的 Office 2016 相容 idMSOsidMSOs compatible with Office 2016 for Mac

如需與適用于 Mac 的 Office 2016 相容的 idMSOs 相關資訊,請參閱下列各項:For information about the idMSOs that are compatible with Office 2016 for Mac, see the following:

另請參閱See also

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.