View Single Post
 
Old 05-31-2017, 06:28 AM
cheech1981 cheech1981 is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Nov 2011
Location: New Jersey, USA
Posts: 77
cheech1981 is on a distinguished road
Default applying heading style within paragraph using macro

Hi all,

I have a macro that moves a freestanding heading to an in-line heading. At the end of the macro, I would like to apply a heading style--for the sake of example, let's say Heading 4.


Example of finished text would be:

Some example heading. Paragraph text begins on same line...


I would like the macro to apply the Heading 4 style to the text "Some example heading" (not including the period). However, when I record this action with the macro recorder and then later try to run the macro, it seems that Word is unable to apply a heading style to a selected portion of text within a line. Is there a way to force this in the VBA code to work around Word's limitation with the macro recorder?
Reply With Quote