WORD Hyperlink to program with paramters

G

Guest

What is the syntax for a WORD hyperlink when the target program
requires/accepts parameters? As a simple example, I want to start IE from a
WORD hyperlink (the user may not have IE as their default browser) and direct
IE to a specific URL. It's not hard to get IE started but I can't figure out
the syntax to pass the URI/URL parameter to IE.

I know IE takes this paramter because as a work around I am currently
pointing the WORD hyperlink at a .bat file (eeewww) with the shell command to
IE with a parm of a URL and it works fine.

What's the syntax? Thanks. LAR
 
J

Jezebel

Just enter the URL as the hyperlink address. You don't have to do anything
else (at least for the example you give).
 
G

Guest

Jezebel,

Perhaps I wasn't clear. If you "just enter the URL" the default browser
will be invoked, which is not always IE. I need to invoke IE specifically,
what a URL as a parameter to the IE invocation. In a desktop short cut it
looks like this:

"C:\Program Files\Internet Explorer\iexplore.exe" http://microsoft.com/

In the HYPERLINK it should look something like:

"C:\\Program Files\\Internet Explorer\\iexplore.exe"
http://prospector.metrolist.net/

but that doesn't work. I've moved the URL in and out of the quotes, etc.
and can't seem to stumble on the correct syntax.

Thanks,

LAR
 
G

Guest

Wow! I didn't realize this was that difficult of a thing to do. Is the
answer to this, "It can't be done"?
 
J

Jezebel

The problem is that you're looking in the wrong place for your answer.
Starting another application, with or without parameters, has nothing to do
with hyperlinking.
 
G

Guest

Um, OK. Can you point me to the right place then? I assumed since I was
inserting a Hyperlink in WORD to active a URL (with IE) that I was in the
right place to ask my question. Where should I ask it?

Thanks for the reply,

LAR
 
T

Tony Jollans

The answer to your question is that what you want can't be done - and if you
tried to do it on my machine you would be banished from the kingdom. Ask
anywhere you like, you'll end up with the same answer: hyperlinks don't work
that way.
 
G

Guest

I apologize for whatever I said to elicite such a crisp reponse. I'm not
sure why I would be banished from your kingdom but I guess I'm just slow.

The WORD help says you can insert a hyperlink to a file as well as a url.
When you insert a URL, WORD clearly invokes a program (the default browser)
with a parameter (the URL). I'm only trying to make this work with IE
specifically, which may not be the default browser.

The procedures that I am creating (in Word) are for internal use and
describe several web sites that must be visited during certain processes.
Some of those web site require the use of IE. Not all of my users have IE as
their default browser. I wanted to make these hyperlinks use IE specifically
and not the default browser.

Seems like a reasonable request but I'm obviously missing something.

LAR
 
T

Tony Jollans

Sorry - a bit sharp perhaps: all I meant was that, if I have set my default
browser to something other than IE, I have done it for a reason and I
wouldn't want something being able to override my choice - even temporarily.

As far as hyperlinks go you can hyperlink to a file (which is just a
specialised url) and that file will be opened with its default associated
program. That's what a hyperlink does. It does not allow you to run a
program and supply parameters to it - that would provide a security hole big
enough to drive a truck through.

If you are running code in Word, there are other techniques you can use to
explicitly start IE but hyperlinks are not the tool to use.

These days, IMO, it's a pretty poor website that requires a particular
browser although I know there are plenty out there
 
G

Guest

Tony,

I am running WORD (2000). I'd be interested in "other techniques" that
won't get me banished from the kingdom if you have some thoughts.

BTW, in my testing, this site doesn't respond well to other than IE. ;-)

Thanks for the reply.

LAR
 
T

Tony Jollans

I'm not entirely sure of all you need to do with this (and don't have any
browser apart from IE on this machine at the moment so can't test) but VBA
code like this might help you get started:

Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.example.com/"

You will need a reference to "Microsoft Internet Controls" (ieframe.dll).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top