Jump to content
Sign in to follow this  

Com and MS-Word Mail merge

Recommended Posts


I am attempting to perform a mail merge using a word doc and tab delimited csv file and am failing badly.

I need some-one to convert a vb script to autoit for me.

Activedocument.MailMerge.OpenDataSource  _ 
      Name:="X:\WindowsIsWierd\Temp\merge.txt", _
      ReadOnly:=False, LinkToSource:=True, _
      PasswordDocument:="",  _
      PasswordTemplate:="", _
      WritePasswordDocument:="", _
      WritePasswordTemplate:="",  _
      Revert:=False, _
      Format:=wdOpenFormatAuto, _
      Connection:="", _
      SQLStatement:="", _
      SQLStatement1 _ :="")

To an autoIT version

Here is my attempt

$word = ObjCreate("word.application"); to run word
$word.visible = 1; to show it
$word.documents.open(@ScriptDir & "\NewRateQuote.doc"); to make a new document
$mm = $word.MailMerge.OpenDataSource("Name:=" &@ScriptDir & "\MMNewQuote.csv, ReadOnly:=1, LinkToSource:=1," _
                                     & "AddToRecentFiles:=0, " _
                                     & "PasswordDocument:='', PasswordTemplate:='', WritePasswordDocument:='', " _
                                                                         & "WritePasswordTemplate:='', Revert:=0, Format:=0," _
                                                                         & "Connection:='', SQLStatement:='', SQLStatement1:=''")




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...