PDA

View Full Version : Reading Special Symbols from Document Object Model



tom.brazee
09-08-2009, 04:36 AM
I extract information sent to me in forms as Microsoft Word tables. I open the document using VB 2005 after setting appropriate references, etc, and navigate through the table's rows and columns to extract the information.

Recently, I have been trying to read documents in which people have been entering chemistry-like items such as arrows, em dashes, and other things that you can enter into a Word document using the "Insert Symbol" option on the "Insert" menu.

After assigning a range to a table cell

Dim Rng As Range = Tab.Cell(R, C).Range

I attempt to look for the symbol characters in the character's collection

Dim CRng as Range = Rng.characters(254)

and then look at the properties of CRng to find which characters which may be defined in a symbol font or a wingdings font.

Unfortunately, the characters all seem to be in the non-symbol font and I don't know how to detect the UniCode characters if they exist. I've been methodically trying many of the properties that IntelliSense pops up, to no avail. The special charactrers show up as the wrong symbol (a right parentheses replaces the chemistry arrow for example).

Can anyone help me with this issue. I'm trying to extract this information, mark it up as special characters, and store it as text characters in a database.

Thanks!

Tinbendr
09-11-2009, 04:58 AM
Could you post a sample to work with?