Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Opening WORD from Excel

Hello, I am using the following code to open and WORD document on my
computer. However I need to send it to a bunch of people and although the
files will be place in a central location, the path that I'm using isn't
accurate for their machines.

How can I change the code to look for each individual document (named the
same as on my computer) and update the path?

Private Sub CommandButton1_Click()
Dim wd As Object
Set wd = CreateObject("Word.Application")
wd.Visible = True
wd.Documents.Open ("C:\Documents and Settings\BOB
REYNOLDS\Desktop\Forms-Letters-COJ\Letters & Merge Data\L01 Appointment
Letter 06282004.doc")
End Sub

The new folder will be on the desktop, but someone else's name.
Thanks so much
Bob Reynolds


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Opening WORD from Excel

Bob,

Something like

Set objShell = CreateObject("Shell.Application")
Set objFolderMyDesk = objShell.Namespace(&H10&)
strMyDeskPath = objFolderMyDesk.Self.Path

will return "strMyDeskPath" as the path string to the individual user's
desktop. If building a path statement, don't forget to include the
backslash &"\"& with the subfolder and file name after.

Steve

"Bob Reynolds" wrote in message
...
Hello, I am using the following code to open and WORD document on my
computer. However I need to send it to a bunch of people and although the
files will be place in a central location, the path that I'm using isn't
accurate for their machines.

How can I change the code to look for each individual document (named the
same as on my computer) and update the path?

Private Sub CommandButton1_Click()
Dim wd As Object
Set wd = CreateObject("Word.Application")
wd.Visible = True
wd.Documents.Open ("C:\Documents and Settings\BOB
REYNOLDS\Desktop\Forms-Letters-COJ\Letters & Merge Data\L01 Appointment
Letter 06282004.doc")
End Sub

The new folder will be on the desktop, but someone else's name.
Thanks so much
Bob Reynolds




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening word docs in excel doss04 Excel Discussion (Misc queries) 3 October 4th 08 06:54 PM
Opening a Word Template from within Excel perry Excel Discussion (Misc queries) 0 January 30th 07 12:23 PM
Opening a Word Template from within Excel perry Excel Worksheet Functions 0 January 30th 07 12:23 PM
Opening a Word template from excel RealmSteel Excel Discussion (Misc queries) 3 November 29th 06 09:16 PM
Excel-Opening Word AW Excel Programming 0 April 2nd 04 09:21 AM


All times are GMT +1. The time now is 06:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"