Determine the FULL paragraph style in Word

Hi experts,

I'm using a VBA macro to collect information on the paragraph style.  It uses a line like this:

Dim para as paragraph
Dim strStyle as string
Dim arrStyles() as string
Dim i as long

i = 0
For each para in activedocument.paragraphs
  i = i + 1
  arrStyles(i) =
next para

That works fine.  However, it records the short version of the paragraph style, for instance:
If the first paragraph is "Header 1" it records "Header 1" in my array.  Good.
But if the first paragraph is "Header 1 + 10pt" it records "Header 1" in my array. Bad.
It always records the short version and never the full one that takes account of user changes.

So my question for all you experts, Is there any way to capture the full name of the style that is actually used as a string.  In other words, how can I get it to say "Header 1 + 10pt" if that is what the style has become?

Thanks in advance for any advice you can offer.


Who is Participating?
The problem is that those the details list character formatting where it differs from the character formatting already associated with the paragraph style.

There can be several of these which can apply to all or part of the paragraph.

I don't think that any of the style properties returns the list, so we may have to analyse the paragraph a character at a time.
Use the description property

arrStyles(i) = para.Style.Description
PatternNutAuthor Commented:
Hi Graham, it has been a while!  I learned so much from all of your tips that I have had very few queries!

However, I'm afraid this one doesn't seem to solve it.  Or maybe it just needs a little more info.  For the same paragraph, the commands return the following: = "Heading 2" = "Normal + Font: Bold, Indent: Left: 0 Cm Hanging: 1.02cm, tabs: 1.02cm, list tab (etc - it goes on for ages)

And the box in word says: Heading 2 + 11pt

Any ideas?


PatternNutAuthor Commented:
Hi Graham,

I don't think that's quite right... I think description is the formatting of the style... and therefore doesn't change when the box says Heading 2 + 11pt. or Heading 2 + Not bold, etc.

But I'm awarding the points anyway because this was a very helpful answer and I really appreciate how much thought you put into this.

Thank ye sir,

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.