Reply
 
Thread Tools Display Modes
  #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


  #2   Report Post  
Tony Jollans
 
Posts: n/a
Default

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

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to: desktop shortcut to bookmark within word document Mani Microsoft Word Help 0 September 25th 05 04:23 PM
How to put the Microsoft Word shortcut icon onto the desktop fredled Microsoft Word Help 2 September 17th 05 10:30 PM
Fields - Which code to place duplicate references? Jason Microsoft Word Help 2 September 16th 05 02:32 PM
How can I let users place pictures into a form? Beau Microsoft Word Help 1 November 26th 04 09:57 AM


All times are GMT +1. The time now is 07:55 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"