View Single Post
 
Old 09-27-2018, 02:12 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote