PDA

View Full Version : VBA to extract word pages (per content) to PDF format.



sam1985
12-08-2022, 11:56 AM
Hi,

I am looking for a VBA to extract word pages (per content) and convert to PDF format.

Example: I have a word document with 30 pages, page 1 - 3 belong to ABC Company, and page 4 belongs to XYZ Company. Page 1 - 3 for ABC Company should be taken and converted to one page PDF and page 4 for XYZ Company should be converted as well to PDF. This process to continue for other account names with different word pages.

I hope I explained it clearly.

Thank you so much for your kind help.
Sam

macropod
12-08-2022, 07:57 PM
It seems your document is probably the result of a mailmerge, in which case you can automate the generation of separate documents from the mailmerge itself. See, for example, Send Mailmerge Output to Individual Files and Run a Mailmerge from Excel, Sending the Output to Individual Files in the Mailmerge Tips & Tricks page at: Mailmerge Tips & Tricks (msofficeforums.com) (https://www.msofficeforums.com/mail-merge/21803-mailmerge-tips-tricks.html). Alternatvely, see Split Merged Output to Separate Documents in the same thread.

macropod
12-08-2022, 08:11 PM
Cross-posted at: VBA to extract word pages to PDF format - Stack Overflow (https://stackoverflow.com/questions/74737959/vba-to-extract-word-pages-to-pdf-format)
Please read VBA Express' policy on Cross-Posting in Rule 3: http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3