Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening word docs in excel | Excel Discussion (Misc queries) | |||
Opening a Word Template from within Excel | Excel Discussion (Misc queries) | |||
Opening a Word Template from within Excel | Excel Worksheet Functions | |||
Opening a Word template from excel | Excel Discussion (Misc queries) | |||
Excel-Opening Word | Excel Programming |