

To make it appear is you just right-click anywhere in the ribbon and select “Customise the Ribbon”. If you don’t have this appearing, that’s perfectly normal for Word, they hide it by default. To add a macro to Word you will need to be able to see the Developer tab. Next recordNum ' Add one to "recordNum" and return to the beginning of the loop (line under "For recordNum = 1.
OFFICE 365 MERGEPDF PDF
and end points to the same number (which is the same as the active record)įileName:=("DocFolderPath").Value & "/" & _įileName:=("PdfFolderPath").Value & "/" & _įileFormat:=wdFormatPDF ' Export "singleDoc" as a PDF with the details provided in the PdfFolderPath and PdfFileName fields in the MailMerge data = recordNum ' Limit the selection to just one document by setting the start. = recordNum ' Change the active record in the MailMerge to the "recordNum" = wdLastRecordįor recordNum = 1 To ' Set "recordNum" to 1 and start loop | second part defines end point for loop Macro) and name it "MailMergeToPdf"ĭim masterDoc As Document, recordNum As Long, singleDoc As Document ' Create variables ("Post-it Notes") for later use Sub MailMergeToPdf() ' Mark the start of the Subroutine (i.e. = wdNextRecord ' otherwise go to the next active record LastRecordNum = 0 ' if so we set lastRecordNum to zero to indicate that the loop should end If >= lastRecordNum Then ' test if we have just created a document for the last record SingleDoc.Close False ' Close "singleDoc", the variable "singleDoc" can now be used for the next record when created

("PdfFileName").Value & ".pdf", _ĮxportFormat:=wdExportFormatPDF ' Export "singleDoc" as a PDF with the details provided in the PdfFolderPath and PdfFileName fields in the MailMerge data OutputFileName:=("PdfFolderPath").Value & Application.PathSeparator & _ ("DocFileName").Value & ".docx", _įileFormat:=wdFormatXMLDocument ' Save "singleDoc" as a word docx with the details provided in the DocFolderPath and DocFileName fields in the MailMerge data Set singleDoc = ActiveDocument ' Identify the ActiveDocument (foremost doc after running the MailMerge) as "singleDoc"įileName:=("DocFolderPath").Value & Application.PathSeparator & _ False ' run the MailMerge based on the above settings (i.e. = ' Limit the selection to just one document by setting the start. = wdSendToNewDocument ' Identify that we are creating a word docx (and no e.g. = wdFirstRecord ' jump to the first active record (active = ticked in edit recipients)ĭo While lastRecordNum > 0 ' create a loop, lastRecordNum is used to end the loop by setting to zero (see below) LastRecordNum = ' retrieve the record number of the last active record so we know when to stop = wdLastRecord ' jump to the last active record (active = ticked in edit recipients) Set masterDoc = ActiveDocument ' Identify the ActiveDocument (foremost doc when Macro run) as "masterDoc" ' Please share freely while retaining attributionĭim masterDoc As Document, singleDoc As Document, lastRecordNum As Long ' Create variables ("Post-it Notes") for later use If you want to know more about Document Sending Profile, please refer to the following link.Sub MailMergeToPdfBasic() ' Mark the start of the Subroutine (i.e. I recommend that clients who frequently use the send mail function select this option. This is a very good improvement in Business Central. No matter how many invoices you select, the Email Details page will appear only once and you only need to send one email to the customer. (False)īecause I selected three invoices, the Email Details page will appear three times and you must send three emails to the customer.Įach email contains an attachment of one invoice.Ģ. If Combine PDF Documents is not selected. On the Posted Sales Invoices page, select posted sales invoices you want to send (Same customer), then Choose Print/Send -> Send…įor example: Selected three posted sales invoices.ġ. For example, this reduces the number of documents the recipient must process. Merge selected documents into a single PDF file when you send the documents by email or print them. On the Document Sending Profile page, after setting Email to Yes, you can see this new field.

As far as I know, this feature was released in the 17.1 version. In this post, I want to share a new feature in Business Central, Combine PDF Documents in Document Sending Profile.
