microsoft from 2.0 controler textbox to retrieve the hindi content in vba

42 Views Asked by At

its showing in textbox correctly Hindi word but while retrieve the value getting like question mark (ex: ????). need the solution in VBA code)

i'm tried to using string retrieve the value but getting like question mark.

EX:

Dim xmlDoc As Object
Dim xmlNodeList As Object
Dim xmlNode As Object
Dim wordNodeList As Object
Dim wordNode As Object
Dim wordText As String
Dim value As Long
' Create a new XML document
Set xmlDoc = CreateObject("MSXML2.DOMDocument")

' Load XML from file
xmlDoc.Load "C:\1\20240314a_001104.xml"

' Check if XML is loaded successfully
If xmlDoc.parseError.ErrorCode <> 0 Then
    MsgBox "Error loading XML: " & xmlDoc.parseError.reason
    Exit Sub
End If

' Get all <word> elements
Set xmlNodeList = xmlDoc.SelectNodes("//word")

' Iterate through each <word> element
For Each xmlNode In xmlNodeList
    ' Get CDATA text inside <word> element
    If TextBox1.text = "" Then
    TextBox1.text = xmlNode.text
    Else
     TextBox1.text = TextBox1.text & xmlNode.text & vbCrLf
    End If
    
    'TextBox1.text = xmlNode.text
    ' Display the word text (you can replace this with your desired handling)
    
    Dim a As String
    a = TextBox1.text
  Next xmlNode

End Sub
0

There are 0 best solutions below