Showing posts with label VSTO. Show all posts
Showing posts with label VSTO. Show all posts

Wednesday, May 23, 2007

VSTO for mere mortals

There is a mistake in Listing 5.8
We try to track the attributes of the font in an excel document, but only track a single attribute.
the code reads
------------------------
If FontBold Then FontAttribute = FontStyle.Bold
If FontItalic Then FontAttribute = FontStyle.Italic
If FontUnderline Then FontAttribute =FontStyle.Underline
=================
This leads to only one attribute being captured since it is overwritten by the next attribute.
The code should read:
-------------------------
If FontBold Then FontAttribute = FontStyle.Bold
If FontItalic Then FontAttribute = FontAttribute Or FontStyle.Italic
If FontUnderline Then FontAttribute = FontAttribute Or FontStyle.Underline
==================
This works properly.