Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-17-2022, 09:16 PM
Guessed's Avatar
Guessed Guessed is offline Sanity check on a macro requirement. Windows 10 Sanity check on a macro requirement. Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Easy to achieve if you are just going every x words. A bit more complex if you want to find x words then adjust forward or back to a paragraph mark.
Code:
Sub Macro1()
  Dim x As Long, lStep As Long
  lStep = 50  'how many words before a page break
  If ActiveDocument.Words.Count > lStep Then
    For x = lStep To ActiveDocument.Words.Count Step lStep
      ActiveDocument.Range.Words(x).InsertAfter Chr(12)
    Next x
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Have a very specific requirement ggoffice000 Excel Programming 2 02-03-2017 03:47 PM
Sanity check on a macro requirement. Sanity check Ulodesk Word Tables 2 11-01-2016 05:57 AM
Spell check macro within macro button field doesn't work in one document samuelle Word VBA 0 07-20-2016 02:27 AM
Sanity check on a macro requirement. Check Box Macro Johnny thunder Word VBA 12 04-07-2011 04:47 PM
automatic requirement numbering with change detection stijnos Word 0 05-13-2009 12:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:29 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