![]() |
|
|
|
#1
|
|||
|
|||
|
If the "control" is not inserted in the document then it is not a control. If you want to
simply get the "content" of the OpenOfficeXMLFileFormat document defined by the value of the node then: Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 9/25/2018 Dim oXMLPart As CustomXMLPart Dim oNode As CustomXMLNode Dim strContent As String Dim arrParts() As String Set oXMLPart = ActiveDocument.CustomXMLParts.SelectByNamespace("http://schemas.microsoft.com/office/...tType").Item(1) Set oNode = oXMLPart.SelectSingleNode("/ns0:contentTypeSchema[1]/@ns1:contentTypeName") strContent = oNode.Text arrParts = Split(strContent, "w:t>") strContent = Left(arrParts(1), Len(arrParts(1)) - 2) MsgBox strContent Set oNode = Nothing Set oXMLPart = Nothing lbl_Exit: Exit Sub End Sub |
|
#2
|
|||
|
|||
|
Thank you so much, Greg
You saved my day
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Content Control content deleted when re-uploading to SharePoint | Peterson | Word | 5 | 06-27-2018 08:13 PM |
| Combo Box Content Control: How to update the list throughout the whole document? | deepak_fer | Word | 9 | 03-18-2018 04:10 AM |
| Gallery Content control and protect document | DarrenOakey | Word | 2 | 08-13-2015 04:56 AM |
| How to protect all parts of a document not in a content control? | XmisterIS | Word | 2 | 05-20-2014 04:59 AM |
Deleting a table from a content control -- preserving the content control
|
BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |