Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-05-2018, 01:35 AM
Fixxxer Fixxxer is offline Split word file into several PDF using the bookmarks as split positions and name Windows 10 Split word file into several PDF using the bookmarks as split positions and name Office 2016
Novice
Split word file into several PDF using the bookmarks as split positions and name
 
Join Date: Oct 2018
Posts: 4
Fixxxer is on a distinguished road
Post Split word file into several PDF using the bookmarks as split positions and name

Hello all and thank you for the help.

I work daily with several word documents that I later save as pdf. I used information to modify a vba macro to directly save to pdf keeping the bookmark structure. This is already a great help, but now I want to take it to the next level:

have a vba that will automatically create several pdfs from the one word file, split at the bookmark point and also adding the bookmark name. Something like "myfile_bookrmakname.pdf".

thank you in advance for all the help.

Below is the code I am using.


PHP Code:
Sub Save_As_PDF()
'


Save_As_PDF Macro
'
'

 
Dim sName As String
    Dim sPath 
As String

    With ActiveDocument
        sName 
Left(.NameInStr(.Name".") - 1)
        
sName sName ".pdf"
        
sPath = .Path "\"

        .ExportAsFixedFormat _
          OutputFileName:=sPath & sName, _
          ExportFormat:=wdExportFormatPDF, _
          OptimizeFor:=wdExportOptimizeForPrint, _
          CreateBookmarks:=wdExportCreateWordBookmarks, _
          DocStructureTags:=True, _
          BitmapMissingFonts:=True
    End With


End Sub 
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Split word file into several PDF using the bookmarks as split positions and name Word VBA - Split Document By Headings - Save File Name As Heading Name jc491 Word VBA 7 01-21-2022 11:04 AM
Split word file into several PDF using the bookmarks as split positions and name split word document based on bookmarks with each new document title of the bookmark megatronixs Word VBA 9 09-05-2020 02:29 PM
Split function in Excel (split the screen) Officer_Bierschnitt Excel 1 07-05-2017 07:02 AM
Split word file into several PDF using the bookmarks as split positions and name Programmatically split a rtf word file without opening Esgrimidor Word VBA 8 03-29-2017 11:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft