Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding a symbol in a text 1

Status
Not open for further replies.

nesplb

Programmer
Jul 29, 2003
109
NO
Hi!

I want to find all the symbols in a text. By this I mean all the symbols that are inserted from the meny with insert->symbol (see pic.)

insertSymbol.jpg


I've tried to search for the symbols using the find method and search for all words with the font = "Symbol". This doesn't work even though the insertSymbol method takes the font "Symbol" as an argument. (I recorded the insertion and watched the code).
Code:
Selection.InsertSymbol Font:="Symbol", CharacterNumber:=-4060, Unicode:= _True

does anyone have any tips so that I can find the symbols in the text?

thanX





Pål Nesteby

PDC-Tangen
Norway
 
I would suggest that the use the character numbers as a filter to find the symbols. If you look at you will see that symbols begin at 128. It should be possible to scan your text per cell and check the Chr of the text.Anything above 127 is a symbol.

Richard
 
ok!
I will try this!

Thank you for the tips!

Pål Nesteby

PDC-Tangen
Norway
 
But.....This should also work for e.g "webdings" and other symbolfonts too. I also see from my code that numbers like "-4060" appears....
Code:
 Selection.InsertSymbol Font:="Symbol", CharacterNumber:=-4060, Unicode:= _
        True

hmmmm.....Thanks for the help so far anyway:)

Pål Nesteby

PDC-Tangen
Norway
 
They are however outside the range of normal ASCII Chrs and thus detectable with Chr
 
I see....But is there a way to detect which symbol-font it is e.g "Symbol" or "Webdings"...?



Pål Nesteby

PDC-Tangen
Norway
 
Thank you very much!
I guess I can get something useful from that one!:)




Pål Nesteby

PDC-Tangen
Norway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top