Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-14-2014, 08:02 AM
gmayor's Avatar
gmayor gmayor is offline Macro for word to add page break and specific text to end of document Windows 7 64bit Macro for word to add page break and specific text to end of document Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
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 ofgmayor has much to be proud of
Default

The Word add-in at http://www.gmayor.com/document_batch_processes.htm will handle the backroom tasks relating to the folders and sub folder processing and it is then a relatively simple process to create a custom function to run from the add-in to insert a specific text at the end, either from the clipboard, or from text saved as an autotext entry or directly from text defined in the function e.g. Using an Autotext entry

Function AddAPage(oDoc As Document) As Boolean
Dim oRng As Range
On Error GoTo Err_Handler
Set oRng = oDoc.Range
oRng.Collapse 0
oRng.InsertBreak wdPageBreak
Set oRng = oDoc.Range
oRng.Collapse 0
Application.Templates("Normal.dotm"). _
BuildingBlockEntries("AutoTextName").Insert _
Where:=oRng, _
RichText:=True
AddAPage = True
lbl_Exit:
Exit Function
Err_Handler:
AddAPage = False
Resume lbl_Exit
End Function
__________________
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for word to add page break and specific text to end of document Macro to insert multiple pictures to word to a specific size and text wrap mescaL Word VBA 3 11-03-2014 10:51 PM
Page Break based on specific work mbesspiata Word 6 01-22-2014 12:40 PM
Macro for word to add page break and specific text to end of document Add Page Break to Document expatchic Word VBA 5 08-08-2012 04:16 PM
Macro for word to add page break and specific text to end of document Deleteing specific text in word document ubns Word 1 05-31-2012 10:38 PM
Macro for word to add page break and specific text to end of document WORD Macro - import picture - resize - position - page break - loop Nano07 Word VBA 2 11-02-2011 05:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:33 PM.


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