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.

What should we write about next?

If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.

Your Name

Your Email

Suggested Topic

Suggestion Details

Looking for support or consultancy with Microsoft Dynamics GP?

I no longer work with Microsoft Dynamics GP, but the last company I worked for was ISC Software in the UK; if you’re looking for support or consultancy services with Microsoft Dynamics GP you can contact them here.

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

Leave a Reply

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