Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open WORD Doc and assign Excel tab as data source for merge.
Hello,
I am using Excel 2003 and Windows XP Pro on my machine. I have a workbook that has a tab named "Database". This "Database" is used to provide information for WORD documents (merge letters) for a mail merge. I need Code to run from the Excel workbook that will open the specific WORD merge letter and assign the datasource tab without seeing a message box or prompt. I found this and it opens the actual document but stops there. WHen I run this I get the message box to select the tab where the data is located. My data is contained in the Excel workbook that is active, and the data is contained in a tab "Database" I don't want to have to select the data base each time and all files will be fixed and no variation in the name. Any Help would be greatly appreciated, BOB REYNOLDS Sub OpenWordDoc() Dim wdApp As Word.Application, wdDoc As Word.Document On Error Resume Next Set wdApp = GetObject(, "Word.Application") If Err.Number < 0 Then 'Word isn't already running Set wdApp = CreateObject("Word.Application") End If On Error GoTo 0 Set wdDoc = wdApp.Documents.Open("C:\LettersFormsCOJMaster\Let ters01232007\L06Closurewithpayment01232007.dot") 'This path is fixed and will not vary. wdApp.Visible = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail Merge With Word, More than 1 Data Source | Excel Discussion (Misc queries) | |||
word can't open excel data source | Excel Discussion (Misc queries) | |||
Excel data source will not merge changes to Word | Excel Discussion (Misc queries) | |||
Link excel and word in mail merge without losing your data source? | Excel Discussion (Misc queries) | |||
Mail Merge from Excel Data Source to Word | Excel Programming |