I am trying to open a file upon form Load() I am getting the file name from a registry Value
On Form Load I get a
"ByRef Argument Type Mismatch" error when I try to load the form.
When I debug print "FileNamefromReg" the the string is correct it is
"C:\Program Files\dtSearch Developer\UserData\ixlib.ilb"
However as you can see when I try to use
LoadDocument FileNamefromReg I get the above error
But if I Use
LoadDocument "C:\Program Files\dtSearch Developer\UserData\ixlib.ilb"
It works just Fine
What the Heck am I doing Wrong!
Thanks in advance
Below is the relevent code.
Private Sub Form_Load()
Const BRANCH = "Software\dtSearch Corp.\DTSEARCH\Indexes"
With Registry1
Dim FileNamefromReg
FileNamefromReg = .QueryValue(epHKEY_CURRENT_USER, BRANCH, "LibraryList")
LoadDocument FileNamefromReg
End With
End Sub
Public Function DisplayContents(sectionName As String)
Dim sectonContent As String
Dim sectionNode As IXMLDOMElement
Dim buffer As String
Dim subElt As IXMLDOMElement
With SectionsList
sectionName = .Text
Set sectionNode = articleDoc.selectSingleNode("//Item[title='" + sectionName + "']")
End With
End Function
Function LoadDocument(url As String)
articleDoc.async = False
articleDoc.Load url
loadSelections
End Function
Public Function loadSelections()
Dim sections As IXMLDOMNodeList
Dim section As IXMLDOMNode
Set sections = articleDoc.selectNodes("//Item")
SectionsList.Clear
For Each section In sections
SectionsList.AddItem section.selectSingleNode("IndexName").Text
Next
SectionsList.ListIndex = 0
End Function
On Form Load I get a
"ByRef Argument Type Mismatch" error when I try to load the form.
When I debug print "FileNamefromReg" the the string is correct it is
"C:\Program Files\dtSearch Developer\UserData\ixlib.ilb"
However as you can see when I try to use
LoadDocument FileNamefromReg I get the above error
But if I Use
LoadDocument "C:\Program Files\dtSearch Developer\UserData\ixlib.ilb"
It works just Fine
What the Heck am I doing Wrong!
Thanks in advance
Below is the relevent code.
Private Sub Form_Load()
Const BRANCH = "Software\dtSearch Corp.\DTSEARCH\Indexes"
With Registry1
Dim FileNamefromReg
FileNamefromReg = .QueryValue(epHKEY_CURRENT_USER, BRANCH, "LibraryList")
LoadDocument FileNamefromReg
End With
End Sub
Public Function DisplayContents(sectionName As String)
Dim sectonContent As String
Dim sectionNode As IXMLDOMElement
Dim buffer As String
Dim subElt As IXMLDOMElement
With SectionsList
sectionName = .Text
Set sectionNode = articleDoc.selectSingleNode("//Item[title='" + sectionName + "']")
End With
End Function
Function LoadDocument(url As String)
articleDoc.async = False
articleDoc.Load url
loadSelections
End Function
Public Function loadSelections()
Dim sections As IXMLDOMNodeList
Dim section As IXMLDOMNode
Set sections = articleDoc.selectNodes("//Item")
SectionsList.Clear
For Each section In sections
SectionsList.AddItem section.selectSingleNode("IndexName").Text
Next
SectionsList.ListIndex = 0
End Function