Microsoft Dynamics GP Macros: Macro By MailMerge

Microsoft Dynamics GPIn this series I am taking a look at how macros can be used to update data in Microsoft Dynamics GP.

The most common way I update a macro template with the data to be updated, is to use Mail Merge in Microsoft Word.

Make sure you have your data prepared: in the demo system I'm using, I have only four users. I have created some new passwords based on the User Name field and stored them in an Excel spreadsheet:

Microsoft Excel

Make sure the file containing your data is closed or the Mail merge will not be able to read the file.

Take the content of the macro file you recorded and paste it into an open Word document (I replaced the data I'm going to repalce with merge fields with XXXX:

Microsoft Word

Click the Mailings tab to change the action pane view, and then click Select Recipients and then Use an Existing List...:

Select Receiptients  - Use an Existing List

In the Select Data Source window, navigate to the location of the source file, select it and click Open:

Select Data Source

Confirm the sheet to use by clicking OK (ensure the First row of data contains columns headers is marked before doing so):

Select Table

Next we want to repalce the XXXX placeholders with the merge fields. Highlight the XXXX next to the User ID, making sure not to select the surrounding apostrophes, and click Insert Merge Field on the action pane; the available fields will be displayed, so select USERID:

Insert USERID merge field

Repeat for the Password and Confirm Password fields (use the same merge field twice):

Insert PASSWORD merge field

Click Finish & Merge on the action pane and select Edit Individual Documents and click OK on the Merge to New Document ? window:

Merge to New Document   ?

A new Word document will be produced containing the data merged into the macro template:

Letters1 document containing macro

This data can be saved as a Text file and then have the extension changed to .mac and is ready to run to update Dynamics GP.

Can ISC Software Solutions help?

ISC Software Solutions are UK and Ireland based experts on Microsoft Dynamics GP. If you'd like to speak to someone about support, consultancy, upgrades, implementation, development, GP Elementz add-ons or portals, or anything else Dynamics GP related, you can use the form below.

Your Name (required):
Your Email (required):
Enquiry message:

What should we write about next?

Your Name (required) -
Your Email (required) -

3 thoughts on “Microsoft Dynamics GP Macros: Macro By MailMerge

Leave a Reply

Your email address will not be published. Required fields are marked *