#1
|
|||
|
|||
Auto Separate Word Doc Per Section Into Multiple PDF's
We have a new reporting system at work that while very useful and clients like it, it can be tedious to upload reports into it. It requires each section of the report to be uploaded to the system as a separate pdf file even though most of these sections come from a single word document. I have searched around and have not had much luck finding a better way to do this. There has to be a way using a macro or something to do this easily. Can somebody please help me? It would need to split the file at each of the main sections (Heading 1 Style) and save each of those as pdf. Even if it just saved each as a separate word document that would help since i could select all of those files to convert each to pdf pretty easily. I greatly appreciate any help on this. |
#2
|
||||
|
||||
You could use Find/Replace to insert a Section break before every 'Heading 1', then process the document using the 'Split Merged Output to Separate Documents' macro in the Mailmerge Tips & Tricks Sticky thread at the top of the mailmerge forum (https://www.msofficeforums.com/mail-...ps-tricks.html). The Find/Replace could even be incorporated into that macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Splendidly devious! I'll have to bookmark that against the unlikely event of being asked the same question … in the meantime, away from Word, I'll just have to make do with the 'Generate separate .pdf document for each file' option <g>
|
#4
|
||||
|
||||
The necessary code would be:
Code:
With .Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = True .Style = wdStyleHeading1 .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute End With Do While .Find.Found = True If i > 0 Then .Duplicate.InsertBreak Type:=wdSectionBreakNextPage .Collapse wdCollapseEnd .Find.Execute i = i + 1 Loop End With With ActiveDocument
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
pdf, separate |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Combine multiple word files into 1 document and add section breaks | svo | Word VBA | 3 | 08-05-2015 03:05 AM |
Creating colour coded columns and auto-generete statistic in separate sheet | krigre | Excel | 1 | 06-10-2015 04:30 AM |
Get multiple cells in separate worksheet | kerkstrt | Excel | 1 | 10-26-2014 11:20 PM |
Auto Fill Multiple Word documents | thebeekeepingbiker | Word | 3 | 07-08-2013 07:23 PM |
Any easy way to separate a Word document into separate files? | SamHelm | Word | 0 | 08-21-2010 05:29 AM |