Posts
413
Comments
230
Trackbacks
42
April 2010 Entries
May 2010 Chicago Architects Group Meeting

CAG

The Chicago Architects Group will be holding its next meeting on May 18th.  Please come and join us and get involved in our architect community.

Register

Presenter: Scott Seely 
Topic: Azure For Architects    
 
Location: TechNexus
200 S. Wacker Dr., Suite 1500
Room A/B
Chicago, IL 60606
Time: 5:30 - Doors open at 5:00

Posted On Wednesday, April 21, 2010 7:25 AM | Comments (2)
Speaking At The Chicago Code Camp

I just got news that my talk on Office Open XML has been accepted for the Chicago Code Camp.  I hear that they will be announcing the full schedule of sessions soon.  Be sure to register and join us.  As a bonus the guys from .NET Rocks will be there.

http://www.chicagocodecamp.com

Posted On Tuesday, April 20, 2010 3:07 AM | Comments (0)
Dealing With Table Borders In OOXML

Note: Cross posted from Coding The Document.
Permalink
Formatting tables in a document programmatically can be a very complex task.  This is the major reason which we start our document generation projects with templates instead of building components in a document by hand. Borders are on aspect of a table that you may want to fomat.  Borders are used to make certain content in a table stand out.  If you need to conditionally set and remove borders there is something that you need to be aware of.  Even in OOXML you have the concepts of styles, inheriting styles and overriding styles. When Word defines a table it will reference a global style such as “TableGrid”.  This style will include the borders for the table.  Specifically the InsideHorizontalBorder and InsideVerticalBorder define the borders for the cells.  These can be overridden by the TableCellBorders collection of a particular cell.  Adding a double right border on a cell is as easy as the couple of lines of code below.

wordprocessing.TableCellBorders borders = new wordprocessing.TableCellBorders();
borders.RightBorder = new RightBorder(){Val = BorderValues.Double, Color = "000000", ThemeColor = ThemeColorValues.Text1, Size = (UInt32Value)4U, Space = (UInt32Value)0U };
cell.TableCellProperties.Append(borders);

If I want to revert back to the table’s style for cell borders I simply need to remove all children from the TableCellBorders collection.  It is like removing a class identifier from a TD tag in HTML.  The style in the parent object takes back over. With the knowledge of how the borders work you can take the concept and apply it to other effects of styles.

Posted On Monday, April 5, 2010 9:43 AM | Comments (0)

Tim Murphy

Tim is a Solutions Architect for PSC Group, LLC. He has been an IT consultant since 1999 specializing in Microsoft technologies. Along with running the Chicago Information Technology Architects Group and speaking on Microsoft and architecture topics he was also contributing author on "The Definitive Guide to the Microsoft Enterprise Library".



I review for the O'Reilly Blogger Review Program



Technorati Profile

www.flickr.com
Tag Cloud