View Single Post
  #1   Report Post  
gils usenet acct
 
Posts: n/a
Default 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