
LinkToSource:=False, Connection:="Provider=.12. OpenDataSource Name:=StrMMSrc, ReadOnly:=True, AddToRecentFiles:=False, _ In the Label Options dialog box, next to Label. On the Mailings tab, click Start Mail Merge > Labels. Step 1: Set up a document to match your labels. Documents.Open(Filename:=StrMMDoc, AddToRecentFiles:=False, ReadOnly:=True, Visible:=False) Creating labels with mail merge is a four-step process: set up a document to match your labels, connect to your spreadsheet, format the merge fields, and then print your labels.

StrMMDoc = ThisWorkbook.Path & "\MailMergeMainDocument.doc"
#How to mail merge from excel to labels code#
'Note: this code requires a reference to the Word object modelĭim wdApp As New Word.Application, wdDoc As Word.Documentĭim StrMMSrc As String, StrMMDoc As String

Having created the mailmerge main document with a single label, you can then use code like the following: Sub RunMerge() What you need to do is create a mailmerge main document with a single label containing all the mergefields required for that label, rather than a sheet of labels, and combine that with an ordinary letter merge. I am fairly new to VBA and would appreciate any help! We'll outline a much more linear process - creating an address file in Excel, merging in Word, and adding intents and finer details.

For more info, see Mail merge: Edit recipients. Learning to use Mail Merge in Microsoft Word can be a daunting task if you're trying to use Microsoft Help. For more info, see Data sources you can use for a mail merge. In the Label Options dialog box, choose your label supplier in the Label vendors list. Go to Mailings > Start Mail Merge > Labels. This is how the data looks like before and after the code is run from the VBA Editor. For more information, see Prepare your Excel data source for mail merge in Word. With your address list set up in an Excel spreadsheet, Outlook Contacts, or a new list you created, you can use mail merge in Word to create mailing labels. Set oWord = CreateObject("Word.Application") Set oHeaders = Range("A1").CurrentRegion.Rows(1) Sub LabelMerge()ĭim oWord As Word.Application, oDoc As Word.Documentĭim sPath As String, I As Integer, oHeaders As Range I was wondering if there is a way that the data from each row in my Excel Spreadsheet could go to different pages in Word? The code is given below. I found a code online that gets all the data into one page on Word. When you merge to this document, the order of the labels should be as you wish.I have been working on a macro that adds data to a page on Word in the form of a Mail Merge label.

