L
Larry
This is really a vba question yet I neglected initially to send it to
the vba group.. I've cancelled the original messages, which had some
mistakes, and I'm starting over.
Is there a command that I could run through VBA that would create a
shortcut to the active Word document and place that shortcut in a
particular folder? Let's say the folder is: C:\Documents\Work
The manual equivalent of this, which I already have, is to add to the
Windows/SendTo folder a shortcut to a .vbs file which sends a shortcut
of the document to the folder. But I want to automate this from within
Word.
Here is the code of the .vbs file. A shortcut to this .vbs file is in
my Windows\SendTo folder. :
Dim fso, Package, PkgName, Destination, link, Top, I
Destination = "C:\Documents\Work"
Set shell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Top = WScript.Arguments.Count
For I = 0 To (Top-1)
Package = WScript.Arguments.Item(I)
PkgName=fso.GetBaseName(Package)
Set link = shell.CreateShortcut(Destination&"\"&PkgName&".lnk")
link.TargetPath = (Package)
link.Save
Next
' MsgBox "Shortcuts to the file(s) or folder(s) are being created
at:"&vbCRLF&Destination
Set shell = Nothing
Set fso = Nothing
Also, in addition to placing a shortcut in the folder, would there be a
command I could run through VBA that would delete the shortcut of the
active document from the C:\Documents\Work folder?
I'm basically trying to come up with a more powerful equivalent of
Word's Work
menu.
I'm working with Word 97, on Windows 98.
Thanks,
Larry
the vba group.. I've cancelled the original messages, which had some
mistakes, and I'm starting over.
Is there a command that I could run through VBA that would create a
shortcut to the active Word document and place that shortcut in a
particular folder? Let's say the folder is: C:\Documents\Work
The manual equivalent of this, which I already have, is to add to the
Windows/SendTo folder a shortcut to a .vbs file which sends a shortcut
of the document to the folder. But I want to automate this from within
Word.
Here is the code of the .vbs file. A shortcut to this .vbs file is in
my Windows\SendTo folder. :
Dim fso, Package, PkgName, Destination, link, Top, I
Destination = "C:\Documents\Work"
Set shell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Top = WScript.Arguments.Count
For I = 0 To (Top-1)
Package = WScript.Arguments.Item(I)
PkgName=fso.GetBaseName(Package)
Set link = shell.CreateShortcut(Destination&"\"&PkgName&".lnk")
link.TargetPath = (Package)
link.Save
Next
' MsgBox "Shortcuts to the file(s) or folder(s) are being created
at:"&vbCRLF&Destination
Set shell = Nothing
Set fso = Nothing
Also, in addition to placing a shortcut in the folder, would there be a
command I could run through VBA that would delete the shortcut of the
active document from the C:\Documents\Work folder?
I'm basically trying to come up with a more powerful equivalent of
Word's Work
menu.
I'm working with Word 97, on Windows 98.
Thanks,
Larry