Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-09-2016, 09:59 PM
Guessed's Avatar
Guessed Guessed is offline Word Macro Shuts Down exactly half way through Document Windows 10 Word Macro Shuts Down exactly half way through Document Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,184
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

You should be using styles rather than local formatting. Try this code
Code:
Sub Underline_Headings()
  Dim aPar As Paragraph
  For Each aPar In ActiveDocument.Paragraphs
    If Len(aPar.Range.Text) < 50 Then
      aPar.Range.Style = "Heading 1"
    End If
  Next aPar
  ActiveDocument.Styles("Heading 1").Font.Underline = wdUnderlineSingle
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word cutting off half the text stacereally Word 3 01-10-2024 08:36 AM
Word shuts down when trying to open certain docs lesliejames Word 0 01-19-2015 11:36 AM
Word Macro Shuts Down exactly half way through Document How do I see one document map for each half of a split MS WORD 2010 document? quickwin Word 3 07-09-2013 10:20 PM
Word Macro Shuts Down exactly half way through Document Scrolling wheel in Excel shuts down my computer... lazlow Excel 1 11-01-2011 10:59 AM
Outlook 2007 Shuts Down in Windows 7 TOActor Outlook 0 03-06-2010 02:39 AM

Other Forums: Access Forums

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