About This Code
Brief Description:
Adding a shortcut to a user's desktop from a hotspot button
Contributor:
Charles Robinson
Category:
Application, Lotusscript
Notes Version:
R6.x, R5.x, R7.x
Last Modified:
24 Aug 2006
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
If you want to send a user an e-mail with a hotspot button to copy a file from a mapped network drive and create a shortcut to it on the user's desktop, use this LotusScript code:
Sub Initialize()
Dim sDesktop As String
Dim sMyDocs As String
Dim oShell As Variant
Dim oShortcut As Variant
Dim oFS As Variant
Set oShell = CreateObject("WScript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")
sDesktop = oShell.SpecialFolders("Desktop")
sMyDocs = oShell.SpecialFolders("MyDocuments")
'Copy the file
Filecopy "P:\Charles\BPS Barcodes.mdb", sMyDocs & "\BPS Barcodes.mdb"
'Create shortcut
Set oShortcut = oShell.CreateShortcut(sDesktop & "\BPS Barcodes.lnk")
oShortcut.TargetPath = sMyDocs & "\BPS Barcodes.mdb"
oShortcut.Save
Messagebox "Installation successful.", 0, "BPS Barcodes"
Enb Sub
Usage / Example