View Single Post
 
Old 08-15-2016, 09:11 AM
LoftySuth LoftySuth is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Aug 2016
Posts: 4
LoftySuth is on a distinguished road
Default

gmayor,
Thanks for your interest. Rather than a packaged answer to my question I was hoping for some help with the coding I thought would be needed. I am used to using VBA with excel but never before with word. I have got the following code (By recording a macro)
Code:
Sub Merge()

    ActiveDocument.MailMerge.MainDocumentType = wdMailingLabels
    ActiveDocument.MailMerge.OpenDataSource Name:= _
        "U:\EVERYBODY!\Antalis\Antalis_BarCodes.xlsx", ConfirmConversions:=False, _
         ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
        PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
        WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
        Connection:= _
        "Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=U:\EVERYBODY!\Antalis\Antalis_BarCodes.xlsx;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Engine Type=37;Jet OLEDB:Database Loc" _
        , SQLStatement:="SELECT * FROM `BARCODES$`", SQLStatement1:="", SubType:= _
        wdMergeSubTypeAccess
    Selection.TypeText Text:=" "
    Selection.TypeParagraph
    
    Selection.Font.Name = "EAN-13"
    Selection.Font.Size = 72
    Selection.TypeText Text:="   "
    Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
        "BASE_EAN_CODE"
    With ActiveDocument.MailMerge
        .Destination = wdSendToNewDocument
        .SuppressBlankLines = True
        With .DataSource
            .FirstRecord = wdDefaultFirstRecord
            .LastRecord = wdDefaultLastRecord
        End With
        .Execute Pause:=False
    End With
End Sub
I have not been able to find any references about repeating a label, nor is it obvious where it would go in the code above.
Can you point me in the direction I should take to progress further?
Lofty
Reply With Quote