Dear Support,
I need to automatize a Mail Merge from a Excel file and Word document. I Find this code on web, can You help me to convert this in macro scheduler code:
=====================
Function MailMergeStart()
Dim objWord As Word.Document
Set objWord = GetObject("c:\Temp\file.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as Excel File.
objWord.MailMerge.OpenDataSource _
Name:="c:\temp\TLS54C_name_CLIENT", _
LinkToSource:=True, _
Connection:=" query nomequerycollegata", _
SQLStatement:="SELECT * FROM TLS54C_name_CLIENT"
' Execute the mail merge.
objWord.MailMerge.Execute
End Function
=================
Thank's for the support
Giovanni Roi
Automation of Mail Merge Excel and Word
Moderators: Dorian (MJT support), JRL
-
- Junior Coder
- Posts: 21
- Joined: Fri Jul 03, 2009 4:36 pm
- Location: Milan,Italy