Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 08-21-2017, 03:08 PM
macropod's Avatar
macropod macropod is offline applying heading style within paragraph using macro Windows 7 64bit applying heading style within paragraph using macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Try something along the lines of:
Code:
Sub ChangeAPA2toAPA3()
'
' ChangeAPA2toAPA3 Macro
' Changes from freestanding APA 2 level subhead to run-in APA level 3 subhead.
' Uses BodyText style to define the trailing paragraph style.
'
With Selection
  .Font.Reset
  With .Paragraphs.Last
    .Style = "Body Text"
    .Range.Case = wdLowerCase
    .Range.Case = wdTitleSentence
  End With
  With .Paragraphs.First
    .Style = "Heading 3"
  End With
  .Collapse wdCollapseStart
  .InsertStyleSeparator
End With
End Sub
Note: The above code assumes you've already split the heading & run-in text into two paragraphs. If you're trying to apply bolding to the "Heading 3" content, that should be done via a change in the Style definition; if you're doing it to the run-in text, you should apply the "Strong" Style to that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
heading styles, macro, recorder



Similar Threads
Thread Thread Starter Forum Replies Last Post
Applying heading style to multiple pages at once jane.bugai Word 5 02-24-2017 04:05 PM
applying heading style within paragraph using macro Using heading style level in a paragraph kam Word 7 03-24-2014 02:58 PM
applying heading style within paragraph using macro Macro to replace one specific heading style with another ubns Word VBA 44 09-04-2012 08:17 PM
applying heading style within paragraph using macro Applying style to first part of paragraph foxtrot Word 3 07-24-2012 07:30 AM
Character style stripped while applying paragraph style sams_gates Word 0 08-29-2009 02:03 AM

Other Forums: Access Forums

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