Private Sub CommandButton2_Click() Dim xmlFile As String Dim XDoc As New MSXML2.DOMDocument60 Dim xmlSelection As IXMLDOMSelection XDoc.async = False XDoc.validateOnParse = True XDoc.SetProperty "SelectionLanguage", "XPath" Dim Query As String Dim Variable As String Query = " //Geometry/Group/Shape/@name" Set xmlSelection = XDoc.SelectNodes(Query) Selection.TypeText (" Query ") Selection.TypeParagraph 

Here is a sample code where I try to output the result, but instead "Query" is output.

I would be extremely grateful for the help

    1 answer 1

    Write without quotes

     Selection.TypeText (Query)