Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2015, 07:19 PM
Crowdie Crowdie is offline Insert manual page breaks Windows 7 64bit Insert manual page breaks Office 2013
Novice
Insert manual page breaks
 
Join Date: Jul 2015
Posts: 2
Crowdie is on a distinguished road
Default Insert manual page breaks

I have a third part reporting application that creates reports in docx format but doesn't insert pages breaks. I create a template in docx format and it replaces certain sections with graphs, etc. but I need to be able to add page breaks in sections that are part of a loop so the final report could have two, three, four, etc. page breaks. For example:

[Loop=floors]
This is floor <floorname>
<show floorplan>
[Somehow instruct Word to insert a page break here]
[Loop Repeat]

Is there anyway I can create an "instruction" to tell Word to insert a manual page break?
Reply With Quote
  #2  
Old 07-30-2015, 08:24 PM
macropod's Avatar
macropod macropod is offline Insert manual page breaks Windows 7 64bit Insert manual page breaks Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

If there is some consistent text (or even a text pattern), for example, that precedes and/or follows everywhere there should be a page break, you could co it via Find/Replace.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-30-2015, 08:41 PM
Crowdie Crowdie is offline Insert manual page breaks Windows 7 64bit Insert manual page breaks Office 2013
Novice
Insert manual page breaks
 
Join Date: Jul 2015
Posts: 2
Crowdie is on a distinguished road
Default

At the moment I have inserted the text "---Break---" into the template and I am doing a find/replace but I was hopeful of finding a more elegant solution.
Reply With Quote
  #4  
Old 07-30-2015, 09:06 PM
gmayor's Avatar
gmayor gmayor is offline Insert manual page breaks Windows 7 64bit Insert manual page breaks Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could run the replacement from a macro via a button on the ribbon, which you may consider more elegant? See http://www.gmayor.com/installing_macro.htm
Code:
Sub AddPageBreaks()
Const strFind As String = "---Break---"
Dim oRng As Range
    Set oRng = ActiveDocument.Range
    With oRng.Find
        Do While .Execute(strFind)
            oRng.Text = ""
            oRng.InsertBreak wdPageBreak
            oRng.Collapse 0
        Loop
    End With
lbl_Exit:
    Set oRng = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 07-30-2015, 09:11 PM
macropod's Avatar
macropod macropod is offline Insert manual page breaks Windows 7 64bit Insert manual page breaks Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Quote:
Originally Posted by Crowdie View Post
At the moment I have inserted the text "---Break---" into the template and I am doing a find/replace but I was hopeful of finding a more elegant solution.
Why are you inserting "---Break---" into the template? Why not insert the page break instead? Moreover, as I've already said, even that can be done via Find/Replace (or a macro using Find/Replace) if there is some consistent text (or even a text pattern), for example, that precedes and/or follows everywhere there should be a page break. Since you haven't provided any detail about that, at this stage we can only speculate.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 07-31-2015, 07:36 AM
Literalman Literalman is offline Insert manual page breaks Windows 7 64bit Insert manual page breaks Office 2010 64bit
Advanced Beginner
 
Join Date: Feb 2015
Posts: 66
Literalman is on a distinguished road
Default

Is "This is floor <floorname>" always going to be at the top of a new page? If so, how about defining a style for that paragraph, and make one of the style's attributes (under "paragraph") be "Page break before"?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert manual page breaks Hidden page breaks and section breaks jrasicmark Word 3 06-02-2014 11:28 PM
Insert manual page breaks Remove Manual Line Breaks not working dvdb Word 2 03-28-2014 12:51 PM
Insert manual page breaks Insert section breaks in a protected document MS help Word 2 03-09-2014 05:27 PM
Insert manual page breaks Page breaks and page numbering sfteam Word 3 06-06-2013 11:56 PM
Deleted Section Breaks Changes Page Breaks Brantnshellie Word 0 02-01-2009 09:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:11 PM.


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