Home

Macros and Programming

 

CardboxForumsMacros and Programming > "Mail Merge to Existing Document"

Mail Merge to Existing Document

Macro needed to open a mail merge using an existing document.

Current user: [none]
Register / Log In · Help

Posted By Post

Voices4Wellbeing

4-Aug-2011 13:24

Hi,

I am trying to make two macros.

The first is to send a mail merge to all of the current selection of records. I have this so far, which does not work

NOTES:
The CardboxCSV.txt is where I have exported to CSV format as mentioned in the help file.
The Orgnames 1,2,3 and 4 are potential contact names of people from the records. I would like these to show up, and then be able to delete the ones that are not applicable, as it is not know which contact we would like to write to.
The Salutation, Firstname, lastname fields are used for individual people, and the ORGNAMES 1,2,3 and 4 are used when the record is for an organisation, and these are potential contact names.

"WriteToFile cbxWriteFormatCSV+cbxWriteOptionFieldHeading+cbxWriteOptionAlwaysQuote, _
            "C:\Users\Gaddum Rochdale 2\Documents\Cardbox Mail Merge\CardboxCSV.txt","SALUTATION,FIRSTNAME,LASTNAME,ORGNAME1,ORGNAME2,ORGNAME3,ORGNAME4,ORGNAME,ADDRESS,POSTCODE"
Set doc=GetObject("C:\Users\Gaddum Rochdale 2\Documents\Cardbox Mail Merge\LETTER TEMPLATE.doc","Word.Document")
Set mm=doc.MailMerge"

Secondly, I would like the option to perform this action for only the current record being viewed. I am assuming that adding:

"ActiveRecord.Tagged=True
SelectTagged
ActiveRecord.Tagged=False"

To the top of the macro would do this?

Quick Reply

Please log in or register before trying to post a reply.

 
© 2010 Cardbox Software Limited   Home