Login | |
|
 |
RE: Creating hyperlinks in a Word doc with VBS - 3/20/2008 3:16:07 AM
|
|
 |
|
| |
ehvbs
Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
|
Hi Thorsteenster, (1) you can't use named arguments to a Sub, Function, or Method in VBScript (in VBA it's possible); so ActiveDocument.Hyperlinks.Add Anchor = ObjSelection.Range, ... isn't legal VBScript. To convert VBA macro code to VBScript you'll have to replace the named arguments by a (correct!) sequence of positional parameters. ActiveDocument.Hyperlinks.Add <FrsParam>, ... To obtain the correct sequence, check the documentation (2) It's illegal in VBScript to use parameter list () when calling a Sub (or a Function or Method as a Sub, i.e. without assigning the return value to a variable); so ActiveDocument.Hyperlinks.Add(ObjSelection.Range, "http://kaboom.org",,, "http://kaboom.org") is bad VBScript. So clean up your "ActiveDocument.Hyperlinks.Add" call. Good luck! ehvbs
|
|
| |
|
|
|
|
|