Тёмный

How to Generate PDF from Mail Merge | Mail Merge Save Separate Files | Mail Merge to PDF and Doc 

Python2020
Подписаться 3,1 тыс.
Просмотров 10 тыс.
50% 1

#mailmerge #mailmergetopdf #mailmergesavesapratefiles #singlefileforeachrow #pdffromexcel
00:00 Intro How to use Mail Merge to Generate PDF
02:00 How to Setup Mail Merge Template to Get PDF
03:00 Mail Merge to Get Separate file for each record
07:00 Mail Merge to Separate PDF from Excel Data
10:00 Mail Merge Get Separate PDF for each row in excel

Наука

Опубликовано:

 

12 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@JeffFahndrich
@JeffFahndrich Год назад
THIS WORKS! Thank you so so much! I will add that if the file name you want to create is not a number, use "As String" instead of "As Long" in the first line otherwise you will get a "Runtime Error 13". Also if it helps, below is the VBA code so you can copy-paste and not be like me literally re-typing everything he has on the screen. Just pay attention to anything in {{ }}: Sub GetPDF() Dim {{merge field}} As String, file_path, folder_path As String folder_path = "C:\Users\{{Username}}\{{other folders}}" If Dir(folder_path, vbDirectory) = "" Then MkDir (folder_path) End If Dim masterDoc As Document, singleDoc As Document, lastRecordNum As Long Set masterDoc = ActiveDocument masterDoc.MailMerge.DataSource.ActiveRecord = wdLastRecord lastRecordNum = masterDoc.MailMerge.DataSource.ActiveRecord masterDoc.MailMerge.DataSource.ActiveRecord = wdFirstRecord Do While lastRecordNum > 0 masterDoc.MailMerge.Destination = wdSendToNewDocument masterDoc.MailMerge.DataSource.FirstRecord = masterDoc.MailMerge.DataSource.ActiveRecord masterDoc.MailMerge.DataSource.LastRecord = masterDoc.MailMerge.DataSource.ActiveRecord masterDoc.MailMerge.Execute False {{merge field}} = masterDoc.MailMerge.DataSource.DataFields("{{merge field}}").Value Set singleDoc = ActiveDocument singleDoc.SaveAs2 FileName:=folder_path & "\" & {{merge field}} & ".docx", FileFormat:=wdFormatXMLDocument singleDoc.ExportAsFixedFormat OutputFileName:=folder_path & "\" & {{merge field}} & ".pdf", ExportFormat:=wdExportFormatPDF singleDoc.Close False If masterDoc.MailMerge.DataSource.ActiveRecord >= lastRecordNum Then lastRecordNum = 0 Else masterDoc.MailMerge.DataSource.ActiveRecord = wdNextRecord End If Loop End Sub
@Python2020
@Python2020 Год назад
Thank you it might help others
@cpkanojiya
@cpkanojiya Год назад
Can you make this video in python laguage.
@Python2020
@Python2020 Год назад
It is already there sir, just brouse my channel video no 12
@supatkhongfak3661
@supatkhongfak3661 Год назад
how can I get that code ? thank you
@Python2020
@Python2020 Год назад
Your email ??
@litolapis9691
@litolapis9691 5 месяцев назад
Hi can i have the code. Thank you
@Python2020
@Python2020 5 месяцев назад
It is same as in the video.. thank you :)
@kaira7793
@kaira7793 Месяц назад
Tried this but it is giving me 5487 cannot complete due to permission
@Python2020
@Python2020 Месяц назад
Not sure if any restriction. You may check options an security..
Далее
Почему худеют от Оземпик?
00:37
Просмотров 66 тыс.
Stop using VLOOKUP in Excel. Switch to INDEX MATCH
11:05
Mail Merge PICTURES to documents [step by step]
24:14
Здесь упор в процессор
18:02
Просмотров 265 тыс.
Здесь упор в процессор
18:02
Просмотров 265 тыс.
#engineering #diy #amazing #electronic #fyp
0:59
Просмотров 339 тыс.