Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-13-2014, 05:53 PM
gmaxey gmaxey is offline Word 2013: CollapseHeading with VBA Windows 7 32bit Word 2013: CollapseHeading with VBA Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

The following collapse the selected paragraph if it is formatted with a built-in heading style:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
If InStr(Selection.Style, "Heading") = 1 Then
  Selection.Paragraphs(1).CollapsedState = True
End If
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Tags
vba, word 2013

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2013: CollapseHeading with VBA Word 2013: Hyperlinks in word created pdf open in web browser and not acrobat reader slaycock Word 5 03-08-2014 01:04 PM
Word 2013: CollapseHeading with VBA Word 2013 cday Word 4 01-16-2014 11:58 AM
Word 2013: CollapseHeading with VBA Word 2013 vs Word 2010 formatting issue? rhoyt Word 1 12-07-2013 09:40 AM
Are user customizations transferable from Word 2003 to Word 2010 (2013)? New Daddy Word 3 01-14-2013 07:25 AM
Which ODF/ .odt version is word 2010, 2013 preview & eventually 2013 full using? semiotically Word 8 11-08-2012 05:44 PM

Other Forums: Access Forums

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