Returning NumberFormat from a bullet

J

JSM

Hi,

I have developed a utility in VB which analyses a Word template and
generates the VBA code required to recreate any outline numbering list
templates which exist (useful when copying outline numbered styles from one
document to another). This works a charm EXCEPT when the outline "numbers"
are bullets. In most cases the NumberFormat property of the ListLevel object
returns "?". What I need is to be able to retrieve the ascii value for the
bullet character. Using
asc(myListLevel.NumberFormat) returns 63 with is the ascii value of a
question mark - not very useful :)

Is there a way that I can return the correct bullet via code? I can
determine the ascii values manually and slot that into the code that my
utility generates but it would be nice for my program to be able to do
this - after all that is what it is for!

Cheers,

John
 
H

Helmut Weber

Hi John,
I don't know whether this is the best way to
get the bullet character number. Seems odd,
but seems to work as well.
Just have a look at it.
 
K

Klaus Linke

Hi John,

As Helmut said... and the trick is to use AscW instead of Asc (since Word
uses Unicode, not ASCII/ANSI).

Regards,
Klaus
 
J

JSM

Hi Helmut,

Thanks for your reply. I couldnt use your code as it was because I am just
cycling through the styles in the template, there may or may not be any text
within the document body therefore I could use the Range object.

However pointing me to the AscW function was very helpful. I was able to get
it working by using AscW then converting back using ChrW within the
outputted code like:

newCode = ".NumberFormat = ChrW(" & AscW(alistlevel.NumberFormat) & ")"

Thanks again for your help!

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top