![]() In the pivot table, you can group the data by Account Owner and then add the other fields as needed. You can create a pivot table by selecting your data and clicking on the "Insert" tab and then "Pivot Table". One way to do this is to use a pivot table in Excel to consolidate the data before performing the mail merge. In a many-to-one mail merge, you'll want to consolidate these rows so that each Account Owner receives only one email with all of their account information. It looks like you have multiple rows with the same Account Owner, Account Name, and Machine Name. Training Video: Mail Merge By Grouping, Table Function to Insert Total of Column Value Multiple Records on Same Page Opens a new window Thank you for your help in this matter!!! Any words of wisdom would be greatly appreciated. I've attached a sample Excel document for what I am trying to accomplish. The deciding fields are Account Owner, Account Name, and Machine Name. An Excel spreadsheet is my source of information and a Word document is where the letter is generated. ![]() In the end, I just want to be able to put my real data in the Excel spreadsheet and edit the Word document to produce an email I can send to account owners. As soon as I add my own data, it fails miserably. I've watched the linked video and a few other videos multiple times, and I've gotten as far as getting the data from the training video to work. I'm inserting the information into a table. I want to perform a many-to-one mail merge and reduce the number of emails that I send out, since there will be multiple accounts and servers assigned to the same account owner. Copy and paste the macro into the new module.For some reason, I'm having a lot of trouble with what I think should be a "simple" mail merge.Right click on Project1 and choose Insert > Module.Open the VBA Editor by pressing Alt+F11 on your keyboard. In Outlook 2007 and older, it’s at Tools, Macro Security.Īfter you test the macro and see that it works, you can either leave macro security set to low or sign the macro. To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. Attachments.Add enviro & "\Documents\instructions.pdf"įirst: You will need macro security set to low during testing. 'The content of the document is used as the body for the email Subject = Left(oDoc.Name, Len(oDoc.Name) - 5) Set oMail = Application.CreateItem(olMailItem) ' match Word mergefields with Outlook fields MsgBox "You need to select Contacts first!" If Not TypeOf Selection.Item(1) Is Outlook.ContactItem Then Set Selection = currentExplorer.Selection Set currentExplorer = Application.ActiveExplorer Set oWord = GetObject(, "Word.Application") Select the contacts you want to email then run the macro. Change the file path in the code as needed. Step 2: Add the macro to Outlook's VB Editor. Save the document, using the desired email subject as the filename as the macro uses the filename as the email subject. Right click on the field and choose Update field if you don't see «fieldname» after pressing Alt+F9. The finished document will look like the following screenshot. Press Alt+F9 to display or hide the field codes. There should be one space between the brackets and the first and last letters. Type the field names in the brackets in this format: MERGEFIELD fieldname. Press Ctrl+F9 to insert the field brackets. I have a similar macro that uses bookmarks instead of merge fields and a version of this macro for printed documents that includes the contact's photo. This Outlook macro uses a Word document containing merge fields to mail merge to email and adds an attachment to the message before sending.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |