...
Go to
http://www.mvps.org/vb/samples.htm, and download the HyperJmp.zip code
sample, and import the .bas module in that file into your project.
All you need to is call the routine passing it your URL, and the default
browser (Internet Explorer or whatever else that might be configured) is
opened at that page.
Hi Jonathon,
Thank you for your reply. Since posting I did manage to trigger an instance
of Internet Explorer using the following :
Sub Upload()
Dim OpenerURL
OpenerURL =
"
https://nww.avon.nhs.uk/cp/login.asp?URL=http://nww.avon.nhs.uk/cms/emergen
cyadmissions.asp&Res=10"
ActiveDocument.FollowHyperlink Address:=OpenerURL, NewWindow:=True,
AddHistory:=True
End Sub
However, I need to take this a bit further....
The Word macro that we have here at the NHS at the moment enables you to
click on a button for the hospital, enter a hospital number (patient number)
and both the GP and patient demographics are returned.
In turn this actually opens a new document *without* the macro or grey
fields on the page which is then ready for printing/saving etc, the previous
document remains unchanged so that they may create another.
What I've been asked to do is link from Word to a .net web application which
I have to write which will enable to the document to be storage in a central
respository.
I have managed thus far to add a button and direct the browser to the
address above - however - I need the querystring to be built up from the
data from the fields which were returned by the database call in the first
place.
I'm not sure how to ;
a) reference the fields on the template to extract data (made more complex
by the fact that the fields on the template never have a value, only the
ones which would have been there on the new document have the data - but
then are not fields - I think)...
Assuming I can do this I can then have a more dynamic querystring enabling
me to acces the application with some data...
example:
I return a patient number (field is called PNumber)
the URL would end up something like:
OpenerURL =
"
https://nww.avon.nhs.uk/cp/login.asp?URL=http://nww.avon.nhs.uk/cds/default
..asp?pnumber=" & pNumber
That kinda thing....
If you have any ideas I would love to hear from ya, I cannot find ANYTHING
of use online at all and have no VBA experience, I come purely from a webby
background using primarily ASP - and just recently moving to .net (which
cant be used for the macro)...
Regards
Rob