jahirh
asked on
To get a URL Address in Netscape Navigator...
Dynamically Constructing an Absolute path of a ActiveX Document
--------------------------
When I compile an ActiveX Document Exe project with multiple ActiveX documents, Visual Basic
creates the .vbd files in the same directory as the ActiveX .exe. However, if I move the .vbd files
into another directory, I have to give the NavigateTo method a fully qualified path for every .vbd
file. Here, I must be able to dynamically create the absolute path.
The following code dynamically constructs the path of a .vbd file by parsing the LocationName
property of Internet Explorer which returns the absolute path of the document currently displayed
by Internet Explorer.
Dim strPath As String ' String to be parsed
Dim strAbsPath As String ' Result of parsing
Dim intI As Integer ' Character position counter
' Return the path of the current ActiveX document.
strPath = Trim$(UserDocument.Parent.
' Find the position of the last separator character.
For intI = Len(strPath) To 1 Step -1
If Mid$(StrPath, intI, 1) = "/" Or _
Mid$(StrPath, intI, 1) = "\" Then Exit For
Next intI
' Strip the name of the current .vbd file.
strAbsPath = Left$(StrPath, intI)
' Navigate to the second ActiveX document.
UserDocument.Hyperlink.Nav
strAbsPath & "MyDoc2.vbd"
--------------------------
In the follwing statement,
strPath = Trim$(UserDocument.Parent.
UserDocument.Parent itself, is not supported in Netscape Communicator 4.03 using Ncompass
DocActive/ScriptActive Plug-in.
I used this facility in a simple application. It works fine in Internet Explorer 3.0 and 4.0. I couldn't get that in Netscape Communicator. We got the following error message :
Run-time error '-2147467259(80004005)
System Error &H80004005{-2147467259}. Unspecified error.
Moreover, Internet Explorer has a built-in facility for storing and retrieving property values through a global Propert bag. This facility and the following are also not supported by Netscape :
userdocuemnt.parent
, userdocument.parent.putpro
userdocument.parent.getpro
So, I want to know any other way( method/property) which is supported by Netscape
Communicator 4.03 to get the path of a vbd or to get the URL Address.
Thanks for reading this.
Hope to get answers from EEEExperts !
Regards
Prabhar
are ypu tryingto get the current URL or the whole list?
ASKER
Hi Dalin,
Thanks for your reply. I'm looking for current URL.
Regards,
Jahirh
Thanks for your reply. I'm looking for current URL.
Regards,
Jahirh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi, Dalin!
Thank you very much for your interest and answer.
Your way is acceptable. But, this takes many lines to get a url address. Internet Explorer supports a single line of code to have the same - Userdocument.parent.locati onname. I need the same in Netscape using any Netscape API's. Inside a userdocument, I can't put this much coding.
Because, I am in position to call several VBD's from a single VBD file in a HTM file. I compile the project ( containg more than one userdocuments )in VB 5.0 and use Application Setup Wizard to have the htm file. HTM file just has one vbd file and it calls the other vbd's. I need the answer in this perspective. If you know know, please, contact me.
Regards
jahirh
Thank you very much for your interest and answer.
Your way is acceptable. But, this takes many lines to get a url address. Internet Explorer supports a single line of code to have the same - Userdocument.parent.locati
Because, I am in position to call several VBD's from a single VBD file in a HTM file. I compile the project ( containg more than one userdocuments )in VB 5.0 and use Application Setup Wizard to have the htm file. HTM file just has one vbd file and it calls the other vbd's. I need the answer in this perspective. If you know know, please, contact me.
Regards
jahirh