Re: create a shortcut in VBA
- From: John Nurick <j.mapSoN.nurick@xxxxxxxxxxxxxx>
- Date: Sun, 22 Jan 2006 17:11:10 +0000
You don't need to use a separate VBScript. Just include the statements
to create and manipulate the WScript.Shell object in an ordinary VBA
procedure.
But read the documentation so you understand what you're doing.
On Sun, 22 Jan 2006 16:37:16 GMT, "Robert M via AccessMonster.com"
<u11609@uwe> wrote:
>
>Thanks, John. Now, I hate to be such a stupe but could you show me how to
>invoke/launch a script from VBA code?
>
>John Nurick wrote:
>>Hi Robert,
>>
>>The WSH (Windows Script Host) Shell object includes methods for
>>manipulating shortcuts. This sample code is from the Windows Script 5.6
>>Help (Script56.CHM; it's installed if you download the latest Windows
>>Script stuff from support.microsoft.com).
>>
>>Set Shell = CreateObject("WScript.Shell")
>>DesktopPath = Shell.SpecialFolders("Desktop")
>>Set link = Shell.CreateShortcut(DesktopPath & "\test.lnk")
>>link.Arguments = "1 2 3"
>>link.Description = "test shortcut"
>>link.HotKey = "CTRL+ALT+SHIFT+X"
>>link.IconLocation = "foo.exe,1"
>>link.TargetPath = "c:\blah\foo.exe"
>>link.WindowStyle = 3
>>link.WorkingDirectory = "c:\blah"
>>link.Save
>>
>>>I am using an Access db to update an exisitng db or install new if necessary.
>>>I would like to copy an exisitng shortcut to the users desktop. Can this be
>>>done in code? If not, how do I create a shortcut in code?
>>
>>--
>>John Nurick [Microsoft Access MVP]
>>
>>Please respond in the newgroup and not by email.
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.
.
- Follow-Ups:
- Re: create a shortcut in VBA
- From: Robert M via AccessMonster.com
- Re: create a shortcut in VBA
- References:
- create a shortcut in VBA
- From: Robert M via AccessMonster.com
- Re: create a shortcut in VBA
- From: John Nurick
- Re: create a shortcut in VBA
- From: Robert M via AccessMonster.com
- create a shortcut in VBA
- Prev by Date: Re: us date format
- Next by Date: Re: Compacting tempory file using code
- Previous by thread: Re: create a shortcut in VBA
- Next by thread: Re: create a shortcut in VBA
- Index(es):
Relevant Pages
|