{"id":110,"date":"2015-09-10T10:26:02","date_gmt":"2015-09-10T10:26:02","guid":{"rendered":"http:\/\/99excel.com\/?p=110"},"modified":"2021-05-14T16:09:21","modified_gmt":"2021-05-14T16:09:21","slug":"create-pdf-file-from-ms-word","status":"publish","type":"post","link":"https:\/\/99excel.com\/home\/create-pdf-file-from-ms-word\/","title":{"rendered":"Create pdf file from ms word"},"content":{"rendered":"<p>Sub pdffilesfromword()<br \/>Application.ScreenUpdating = False<br \/> Dim DocName As String, PDFPath, Folderpath, From, Till, Message, fs<br \/> Folderpath = &#8220;C:Merged Letters In PDF File From Word&#8221;<\/p>\n<p> Set fs = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br \/> If fs.FolderExists(Folderpath) = False Then<br \/> fs.createfolder (Folderpath)<br \/> Else: End If<\/p>\n<p>From = 1<br \/>Till = 5<\/p>\n<p>Message = (Till &#8211; From) + 1<\/p>\n<p>While From &lt;= Till<\/p>\n<p>ActiveDocument.MailMerge.DataSource.ActiveRecord = From<br \/> DocName = ActiveDocument.Fields(1).Result<br \/> &#8216;CheckFilename for: ?ActiveDocument.Fields(1).Code<br \/> PDFPath = Folderpath &amp; &#8220;&#8221; &amp; DocName &amp; &#8220;.pdf&#8221;<br \/> Massage = ((Till &#8211; From) + 1)<\/p>\n<p> ActiveDocument.ExportAsFixedFormat OutputFileName:=PDFPath, ExportFormat:= _<br \/> wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, _<br \/> Item:=wdExportDocumentContent, IncludeDocProps:=True<\/p>\n<p>From = From + 1<br \/>Wend<\/p>\n<p>MsgBox (Message &amp; &#8221; Pdf Files Saved In = &#8221; &amp; Folderpath)<\/p>\n<p>End Sub<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sub pdffilesfromword()Application.ScreenUpdating = False Dim DocName As String, PDFPath, Folderpath, From, Till, Message, fs Folderpath = &#8220;C:Merged Letters In PDF File From Word&#8221; Set fs = CreateObject(&#8220;Scripting.FileSystemObject&#8221;) If fs.FolderExists(Folderpath) = False Then fs.createfolder (Folderpath) Else: End If From = 1Till = 5 Message = (Till &#8211; From) + 1 While From &lt;= Till ActiveDocument.MailMerge.DataSource.ActiveRecord = &#8230; <a title=\"Create pdf file from ms word\" class=\"read-more\" href=\"https:\/\/99excel.com\/home\/create-pdf-file-from-ms-word\/\" aria-label=\"More on Create pdf file from ms word\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":1,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":899,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/110\/revisions\/899"}],"wp:attachment":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}