Word for Mac 2011 VBA 对象模型中的间隙的解决方法?

发布于 2024-10-07 19:38:37 字数 1116 浏览 0 评论 0原文

Word 2007/2010 VBA 对象模型中似乎有很多东西在 Word 2011 VBA 中完全缺失。

具体来说,Word 2007(适用于 Windows)包括与以下内容相关的对象和方法:

  • ContentControls
  • CustomXMLParts
  • OpenXML

例如:

**Word.Document**

Property ContentControls As ContentControls
contentcontrol events eg Event ContentControlAfterAdd(NewContentControl As ContentControl, InUndoRedo As Boolean)

Property CustomXMLParts As CustomXMLParts

Property WordOpenXML As String

**Word.ContentControl**

Property XMLMapping As XMLMapping

**Word.ContentControls**

Function Add([Type As WdContentControlType = wdContentControlRichText], [Range]) As ContentControl

**Word.Selection/Word.Range**

Sub InsertXML(XML As String, [Transform])

在 Word 2011 的 VBA 编辑器中,我找不到其中任何一个。

Word 2011 VBA 和 Word 2010 VBA 对象模型之间的差异是否记录在任何地方?

我还浏览/搜索了脚本编辑器的字典,以查看其中是否公开了这些对象。他们不是。

在我到目前为止的实验中,Word 2011 确实在 docx 中保留了现有的内容控件(即保存了它们),但是您无法在 UI 的文档表面上看到它们,而且似乎没有任何方法可以添加新的(通过“开发人员”选项卡,或通过 VBA 或 AppleScript)。

那么,对于如何处理 Word for Mac 2011 VBA 对象模型中的空白,特别是如何在 Mac 上的 Word 中使用内容控件和自定义 xml,有什么建议吗?

There seem to be a bunch of things in the Word 2007/2010 VBA object model which are simply missing in Word 2011 VBA.

Specifically, Word 2007 (for Windows) includes objects and methods related to:

  • ContentControls
  • CustomXMLParts
  • OpenXML

For example:

**Word.Document**

Property ContentControls As ContentControls
contentcontrol events eg Event ContentControlAfterAdd(NewContentControl As ContentControl, InUndoRedo As Boolean)

Property CustomXMLParts As CustomXMLParts

Property WordOpenXML As String

**Word.ContentControl**

Property XMLMapping As XMLMapping

**Word.ContentControls**

Function Add([Type As WdContentControlType = wdContentControlRichText], [Range]) As ContentControl

**Word.Selection/Word.Range**

Sub InsertXML(XML As String, [Transform])

In the VBA editor in Word 2011, I can't find any of these.

Are the differences between Word 2011 VBA and Word 2010 VBA object models documented anywhere?

I've also browsed/searched the Script Editor's dictionary, to see whether any of these objects are exposed there. They aren't.

In my experiments so far, Word 2011 does preserve existing content controls in a docx (ie it saves them), but you can't see them on the document surface in the UI, and there doesn't seem to be any way to add new ones (either via the Developer tab, or via VBA or AppleScript).

So, any suggestions as to how to work with around gaps in the Word for Mac 2011 VBA object model generally, and in particular how to work with content controls and custom xml in Word on the Mac?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

锦爱 2024-10-14 19:38:37

不幸的是,VBA 中的 CC 工作似乎已从 Mac Word 2011 VBA 中删除。请参阅此页面:

Microsoft Word 2010 中的对象模型更改

Mac Word 2011 VBA 的完整在线帮助位于: http://mac2.microsoft.com/vb/1033/default.aspx?src=wd

Unfortunately it appears that CC work in VBA has been removed from Mac Word 2011 VBA. See this page:

Object Model Changes from Microsoft Word 2010

The full online help for Mac Word 2011 VBA is at: http://mac2.microsoft.com/vb/1033/default.aspx?src=wd

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文