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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…