View Single Post
 
Old 10-14-2021, 04:25 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,163
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Assuming your don't want to deal with xml-based code and the attribute order is always consistent, you could use something like this to extract the content
Code:
Sub Macro1()
  Dim sText As String, arrText() As String, i As Integer, sOutput As String
  sText = ActiveDocument.Paragraphs(1).Range.Text
  arrText = Split(sText, """")
'  For i = LBound(arrText) To UBound(arrText)
'    Debug.Print i, arrText(i)
'  Next i
  sOutput = arrText(9) & vbLf & arrText(3) & vbLf & arrText(15) & vbLf & arrText(1)
  Debug.Print sOutput
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote