Command to send active document's shortcut to a folder

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

Is there a command (probably a DOS command) that I could run through VBA
that would send the active Word document to a particular folder as a
shortcut? Let's say the folder is: C:\Documents\Work

The manual equivalent of this would be to add a shortcut to the Work
folder to the Windows\SendTo folder, and go to the active document's
icon in its folder and click on Send to. But it would be neat to
automate this.

Also, 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?

You see how I'm trying to come up with my own equivalent of Word's Work
menu.

I'm working with Word 97, on Windows 98.

Thanks,
Larry
 
I already have this set up as part of the Send To menu. In the Send To
menu I have a shortcut to a .vbs file which contains the below code.
When I click on that item in the Send To menu, it sends a shortcut of
the current file to the named folder. It works fine. But what I want
to do is automate this through VBA, so that I can do the same thing from
the active document in Word, that is, run a macro that will send a
shortcut of the active document to the Work 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
 
May as well just leave them. No one is responding anyhow! Cancel won't
always work. The site must choose to process it.

--
Thanks or Good Luck,
There may be humor in this post, and,
Naturally, you will not sue,
should things get worse after this,
PCR
(e-mail address removed)
| I cancelled these posts but they're still here.
|
|
|
 
PCR,
I was gonna say tis nice to see you over here until I realised the OP had
multi-posted, lol

Ah well, tis nice to see you anyway <g>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
I am not a traveling man. I DON'T want to run into rogues & vagabonds!
However, I do hope you fare well, Burn.


--
Thanks or Good Luck,
There may be humor in this post, and,
Naturally, you will not sue,
should things get worse after this,
PCR
(e-mail address removed)
| PCR,
| I was gonna say tis nice to see you over here until I realised the OP
had
| multi-posted, lol
|
| Ah well, tis nice to see you anyway <g>
|
| --
|
| Regards
|
| Steven Burn
| Ur I.T. Mate Group
| www.it-mate.co.uk
|
| Keeping it FREE!
|
|
| | > May as well just leave them. No one is responding anyhow! Cancel
won't
| > always work. The site must choose to process it.
| >
| > --
| > Thanks or Good Luck,
| > There may be humor in this post, and,
| > Naturally, you will not sue,
| > should things get worse after this,
| > PCR
| > (e-mail address removed)
| > | > | I cancelled these posts but they're still here.
| > |
| > |
| > |
| >
| >
|
|
 
hehe, depends on how much the fare costs ;o)

I've actually just been over the win98 NG and boy has it changed (I couldn't
find so much as one post from the idiots that used to post there, lol (and
no, I didn't mean the MVP's <g>)).

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
microsoft.public.win98.gen_discussion, you mean? You used to think we
were idiots!!???

--
Thanks or Good Luck,
There may be humor in this post, and,
Naturally, you will not sue,
should things get worse after this,
PCR
(e-mail address removed)
| hehe, depends on how much the fare costs ;o)
|
| I've actually just been over the win98 NG and boy has it changed (I
couldn't
| find so much as one post from the idiots that used to post there, lol
(and
| no, I didn't mean the MVP's <g>)).
|
| --
|
| Regards
|
| Steven Burn
| Ur I.T. Mate Group
| www.it-mate.co.uk
|
| Keeping it FREE!
|
|
| | > I am not a traveling man. I DON'T want to run into rogues &
vagabonds!
| > However, I do hope you fare well, Burn.
| >
| >
| > --
| > Thanks or Good Luck,
| > There may be humor in this post, and,
| > Naturally, you will not sue,
| > should things get worse after this,
| > PCR
| > (e-mail address removed)
| > | > | PCR,
| > | I was gonna say tis nice to see you over here until I realised the
OP
| > had
| > | multi-posted, lol
| > |
| > | Ah well, tis nice to see you anyway <g>
| > |
| > | --
| > |
| > | Regards
| > |
| > | Steven Burn
| > | Ur I.T. Mate Group
| > | www.it-mate.co.uk
| > |
| > | Keeping it FREE!
| > |
| > |
| > | | > | > May as well just leave them. No one is responding anyhow! Cancel
| > won't
| > | > always work. The site must choose to process it.
| > | >
| > | > --
| > | > Thanks or Good Luck,
| > | > There may be humor in this post, and,
| > | > Naturally, you will not sue,
| > | > should things get worse after this,
| > | > PCR
| > | > (e-mail address removed)
| > | > | > | > | I cancelled these posts but they're still here.
| > | > |
| > | > |
| > | > |
| > | >
| > | >
| > |
| > |
| >
| >
|
|
 
Ah, OK! OK, then. Glad to see you back, then.

--
Thanks or Good Luck,
There may be humor in this post, and,
Naturally, you will not sue,
should things get worse after this,
PCR
(e-mail address removed)
| ROFLMAO!...... I wasn't talking about you guys!
|
| --
|
| Regards
|
| Steven Burn
| Ur I.T. Mate Group
| www.it-mate.co.uk
|
| Keeping it FREE!
|
|
| | > microsoft.public.win98.gen_discussion, you mean? You used to think
we
| > were idiots!!???
| >
| > --
| > Thanks or Good Luck,
| > There may be humor in this post, and,
| > Naturally, you will not sue,
| > should things get worse after this,
| > PCR
| > (e-mail address removed)
| > | > | hehe, depends on how much the fare costs ;o)
| > |
| > | I've actually just been over the win98 NG and boy has it changed
(I
| > couldn't
| > | find so much as one post from the idiots that used to post there,
lol
| > (and
| > | no, I didn't mean the MVP's <g>)).
| > |
| > | --
| > |
| > | Regards
| > |
| > | Steven Burn
| > | Ur I.T. Mate Group
| > | www.it-mate.co.uk
| > |
| > | Keeping it FREE!
| > |
| > |
| > | | > | > I am not a traveling man. I DON'T want to run into rogues &
| > vagabonds!
| > | > However, I do hope you fare well, Burn.
| > | >
| > | >
| > | > --
| > | > Thanks or Good Luck,
| > | > There may be humor in this post, and,
| > | > Naturally, you will not sue,
| > | > should things get worse after this,
| > | > PCR
| > | > (e-mail address removed)
| > | > | > | > | PCR,
| > | > | I was gonna say tis nice to see you over here until I realised
the
| > OP
| > | > had
| > | > | multi-posted, lol
| > | > |
| > | > | Ah well, tis nice to see you anyway <g>
| > | > |
| > | > | --
| > | > |
| > | > | Regards
| > | > |
| > | > | Steven Burn
| > | > | Ur I.T. Mate Group
| > | > | www.it-mate.co.uk
| > | > |
| > | > | Keeping it FREE!
| > | > |
| > | > |
| > | > | | > | > | > May as well just leave them. No one is responding anyhow!
Cancel
| > | > won't
| > | > | > always work. The site must choose to process it.
| > | > | >
| > | > | > --
| > | > | > Thanks or Good Luck,
| > | > | > There may be humor in this post, and,
| > | > | > Naturally, you will not sue,
| > | > | > should things get worse after this,
| > | > | > PCR
| > | > | > (e-mail address removed)
| > | > | > | > | > | > | I cancelled these posts but they're still here.
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > | >
| > | > |
| > | > |
| > | >
| > | >
| > |
| > |
| >
| >
|
|
 
Back
Top