#1
|
|||
|
|||
Determine Style of paragraph at current location
I need to use the paragraph Style at the current location to select what action I need to take.
Another VBA macro will be called based on the style. E.g., If the Style is "Introduction" then delete the current paragraph, 'insert some text from the clipboard Selection.PasteAndFormat (wdFormatPlainText) ' prepare the next paragraph Selection.Style = ActiveDocument.Styles("Body") How do I determine the current style? |
#2
|
||||
|
||||
This will show you the current paragraph style
Code:
Debug.Print Selection.Range.Paragraphs(1).Style
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Thank you. I tried all kind of variations of that, but not that one.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Delete the current paragraph by just one click without selecting it | RobertDany | Word VBA | 2 | 10-10-2021 09:55 PM |
Is there a way programmatically to determine the footnote number style, if other than arabic numbers | gn4619 | Word VBA | 2 | 11-23-2015 11:00 PM |
determine location of object via calculation | sarahtalbot | Visio | 0 | 01-08-2015 03:27 AM |
A macro that moves the current paragraph up or down? | New Daddy | Word VBA | 2 | 04-13-2014 02:25 PM |
Character style stripped while applying paragraph style | sams_gates | Word | 0 | 08-29-2009 02:03 AM |