Home |
Search |
Today's Posts |
#1
|
|||
|
|||
code to place shortcut on user's desktop or Start menu?
Hi All,
I am seeking VBA terminology for the route to the pc's current user's desktop or Start Menu. What can I insert below instead of "All Users"? I am writing code to put a program shortcut on the user's desktop. Dim strDefFilePath As String, strFileToCopy As String Dim strSourcePath As String, strSourceFile As String Dim objFSO As Object strSourcePath = "c:\Patients\AMR\" strFileToCopy = "Ten Second EMR 2.doc" strDefFilePath = "c:\Documents and Settings\All Users\Start Menu\Programs\" strSourceFile = strSourcePath & strFileToCopy Set objFSO = CreateObject("scripting.FileSystemObject") objFSO.copyfile LCase(strSourceFile), LCase(strDefFilePath) Set objFSO = Nothing Kill "C:\Patients\AMR\Ten Second Medical Record 2.doc" TIA, Gil |
#2
|
|||
|
|||
There are a couple of ways, easiest is probably to use ..
strDefFilePath = "c:\Documents and Settings\" & Environ("UserName") & "\Start Menu\Programs\" -- Enjoy, Tony "gils usenet acct" wrote in message ... Hi All, I am seeking VBA terminology for the route to the pc's current user's desktop or Start Menu. What can I insert below instead of "All Users"? I am writing code to put a program shortcut on the user's desktop. Dim strDefFilePath As String, strFileToCopy As String Dim strSourcePath As String, strSourceFile As String Dim objFSO As Object strSourcePath = "c:\Patients\AMR\" strFileToCopy = "Ten Second EMR 2.doc" strDefFilePath = "c:\Documents and Settings\All Users\Start Menu\Programs\" strSourceFile = strSourcePath & strFileToCopy Set objFSO = CreateObject("scripting.FileSystemObject") objFSO.copyfile LCase(strSourceFile), LCase(strDefFilePath) Set objFSO = Nothing Kill "C:\Patients\AMR\Ten Second Medical Record 2.doc" TIA, Gil |
#3
|
|||
|
|||
Thanks Tony, ....
worked out fine. Cheers, Gil "Tony Jollans" Nomail wrote in message ... There are a couple of ways, easiest is probably to use .. strDefFilePath = "c:\Documents and Settings\" & Environ("UserName") & "\Start Menu\Programs\" -- Enjoy, Tony "gils usenet acct" wrote in message ... Hi All, I am seeking VBA terminology for the route to the pc's current user's desktop or Start Menu. What can I insert below instead of "All Users"? I am writing code to put a program shortcut on the user's desktop. Dim strDefFilePath As String, strFileToCopy As String Dim strSourcePath As String, strSourceFile As String Dim objFSO As Object strSourcePath = "c:\Patients\AMR\" strFileToCopy = "Ten Second EMR 2.doc" strDefFilePath = "c:\Documents and Settings\All Users\Start Menu\Programs\" strSourceFile = strSourcePath & strFileToCopy Set objFSO = CreateObject("scripting.FileSystemObject") objFSO.copyfile LCase(strSourceFile), LCase(strDefFilePath) Set objFSO = Nothing Kill "C:\Patients\AMR\Ten Second Medical Record 2.doc" TIA, Gil |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to: desktop shortcut to bookmark within word document | Microsoft Word Help | |||
How to put the Microsoft Word shortcut icon onto the desktop | Microsoft Word Help | |||
Fields - Which code to place duplicate references? | Microsoft Word Help | |||
How can I let users place pictures into a form? | Microsoft Word Help |