Results 1 to 2 of 2

Thread: Need to help to read a XML file

  1. #1

    Need to help to read a XML file

    Hi ,

    I have attached a file with this post . It is a XMl file

    At the end of the file the folliwing snippet will be seen

    I need to use vb script to get the value of group id.
    I have used the syntax below.
    oNode = oDoc.getElementsByTagName("ns1:GroupId")
    sGroupId = oNode.Text

    But I cannot get the groupid value. Please help. Thank you
    Attached Files Attached Files

  2. #2
    If you open the document in Word it will translate the xml and you could use VBA to get the value that you want e.g.
    Sub Macro1()
    Dim oRng As Range
    Dim lngPara As Long
        For lngPara = ActiveDocument.Paragraphs.Count To 1 Step -1
            Set oRng = ActiveDocument.Paragraphs(lngPara).Range
            oRng.End = oRng.End - 1
            If IsNumeric(Trim(oRng.Text)) = True Then
                MsgBox oRng.Text
                Exit For
            End If
        Next lngPara
        Set oRng = Nothing
    End Sub
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts