
Signature
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --
Am Wed, 22 Nov 2006 08:53:02 -0800 schrieb A1pro:
Thanks that works great
One thing i'm struggling with now is that, .targetpath seems to add quotes
(") at the beginning and end of whatever you set .targetpath to be.
Is there anyway around this. Because that way you cannot set a shortcut to a
webpage.
command needed to link to a webpage: "C:\Program Files\Internet
Explorer\IEXPLORE.EXE" 62.30.31.74
if I set .targetpath to be : "C:\Program Files\Internet
Explorer\IEXPLORE.EXE" 62.30.31.74
The result is "C:\Program Files\Internet Explorer\IEXPLORE.EXE 62.30.31.74"
which does not work.
Any ideas?
Also is there an easy way to embed this macro on an email.
So when the recipient opens the email, it will run the macro automatically
TIA
> You can call the object without a ref:
> Dim WSH As Object
[quoted text clipped - 52 lines]
> >>
> >> TIA
A1pro - 23 Nov 2006 10:38 GMT
Ok, So I found out that if you just set targetpath to http://ipaddress it works
Now I need to create it on desktop. This has to go to several people, and I
do not know their desktop filepaths
I found this command
DesktopPath = WSHShell.SpecialFolders("Desktop"), it works fine for
scripting but I can't make it work on vba
any ideas?
TIA
> Thanks that works great
>
[quoted text clipped - 77 lines]
> > >>
> > >> TIA
A1pro - 23 Nov 2006 10:57 GMT
This seems to do the programatic trick:
Sub CreateShortcut()
On Error Resume Next
Dim wsShell As Object
Dim wsSCut As Object
Set wsShell = CreateObject("WScript.Shell")
DesktopPath = wsShell.SpecialFolders("Desktop") 'Finds Desktop folder
shortcutPath = DesktopPath & "\" & "telewest.lnk" ' adds shortcut name
Set wsSCut = wsShell.CreateShortcut(shortcutPath) ' creates shortcut
With wsSCut
.TargetPath = "http://62.30.31.74" ' this selects iexplorer and sets
the ip address
.Save
End With
Set wsSCut = Nothing
Set wsShell = Nothing
End Sub
Now I'm trying to think how to distribute it.
Any way to embed this on an email?
or do security issues get on the way?
any help would be appreciated
TIA
Michael Bauer [MVP - Outlook] - 24 Nov 2006 06:27 GMT
Hopefully there's no way to get it executed automatically. Maybe you can
create a *.vbs file, attach that to the e-mail and ask the user to save the
attachment as a file and run it.

Signature
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --
Am Thu, 23 Nov 2006 02:57:01 -0800 schrieb A1pro:
> This seems to do the programatic trick:
> Sub CreateShortcut()
[quoted text clipped - 31 lines]
>
> TIA