Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2015, 12:28 PM
DaveWW00 DaveWW00 is offline Auto Separate Word Doc Per Section Into Multiple PDF's Windows 7 64bit Auto Separate Word Doc Per Section Into Multiple PDF's Office 2010 64bit
Novice
Auto Separate Word Doc Per Section Into Multiple PDF's
 
Join Date: Aug 2013
Posts: 2
DaveWW00 is on a distinguished road
Question 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.
Reply With Quote
  #2  
Old 08-05-2015, 06:48 PM
macropod's Avatar
macropod macropod is offline Auto Separate Word Doc Per Section Into Multiple PDF's Windows 7 64bit Auto Separate Word Doc Per Section Into Multiple PDF's Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 08-05-2015, 11:12 PM
eNGiNe eNGiNe is offline Auto Separate Word Doc Per Section Into Multiple PDF's Windows 7 32bit Auto Separate Word Doc Per Section Into Multiple PDF's Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

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>
Reply With Quote
  #4  
Old 08-05-2015, 11:55 PM
macropod's Avatar
macropod macropod is offline Auto Separate Word Doc Per Section Into Multiple PDF's Windows 7 64bit Auto Separate Word Doc Per Section Into Multiple PDF's Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
inserted after:
With ActiveDocument
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

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
Auto Separate Word Doc Per Section Into Multiple PDF's Get multiple cells in separate worksheet kerkstrt Excel 1 10-26-2014 11:20 PM
Auto Separate Word Doc Per Section Into Multiple PDF's 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:54 AM.


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