![]() |
How to open a merged word document
Please help me to write a macro that would allow me open a
merged word doc. from Excel. The document already has a datasource. Is this possible? Please help soon. Thanks. |
How to open a merged word document
Here are a couple of macros that should help.
Sub openxmas() Dim appWD As Object Dim wdDoc As Document Set appWD = CreateObject("Word.Application") appWD.Visible = True appWD.ChangeFileOpenDirectory ActiveWorkbook.Path appWD.Documents.Open Filename:="XmasListEnvelopes.doc" Set wdDoc = appWD.ActiveDocument End Sub Sub OpenDocument() Dim wdApp As Word.Application strFilename = "XmasListEnvelopes1.doc" Set wdApp = CreateObject("Word.Application") With wdApp .Documents.Open Filename:=ThisWorkbook.Path & "\" & strFilename .Visible = True End With Set wdApp = Nothing End Sub -- Don Guillett SalesAid Software "Tonja" wrote in message ... Please help me to write a macro that would allow me open a merged word doc. from Excel. The document already has a datasource. Is this possible? Please help soon. Thanks. |
How to open a merged word document
Thank you very much.
-----Original Message----- Here are a couple of macros that should help. Sub openxmas() Dim appWD As Object Dim wdDoc As Document Set appWD = CreateObject("Word.Application") appWD.Visible = True appWD.ChangeFileOpenDirectory ActiveWorkbook.Path appWD.Documents.Open Filename:="XmasListEnvelopes.doc" Set wdDoc = appWD.ActiveDocument End Sub Sub OpenDocument() Dim wdApp As Word.Application strFilename = "XmasListEnvelopes1.doc" Set wdApp = CreateObject("Word.Application") With wdApp .Documents.Open Filename:=ThisWorkbook.Path & "\" & strFilename .Visible = True End With Set wdApp = Nothing End Sub -- Don Guillett SalesAid Software "Tonja" wrote in message ... Please help me to write a macro that would allow me open a merged word doc. from Excel. The document already has a datasource. Is this possible? Please help soon. Thanks. . |
How to open a merged word document
|
All times are GMT +1. The time now is 03:36 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com