ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to open a merged word document (https://www.excelbanter.com/excel-programming/285675-how-open-merged-word-document.html)

Tonja[_2_]

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.


Don Guillett[_4_]

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.




Tonja[_2_]

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.



.


Don Guillett[_4_]

How to open a merged word document
 
glad to help

--
Don Guillett
SalesAid Software

"Tonja" wrote in message
...
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.



.





All times are GMT +1. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com