Staff DotNet Blogs

Drawing objects like TextBoxes are stored in separated xml parts referenced inside the sheet part by using a relation.  You can get the xml markup for the TextBox (or drawing) by opening the [sheetName].xml part (where [sheetName] corresponds to the sheet where the drawing is located) and looking for the elements.  Then, you take the relationship id indicated by the r:id attribute , open the [sheetName].xml. rels files and look for the Relationship element whose Id attribute corresponds with value for the r:id attribute indicated previously.  The Target attribute for the Relationship element will tell you where the xml part containing the drawing definition is located.

Once you know the location for the drawing you want to modify you can open it and in order to set the row and column values you look for the following elements: xdr:From and xdr:To.  Inside these elements there are two sub elements named xdr:col and xdr:row.  These are the elements you need to modify in order to set the starting and ending row and column for the drawing.

Comments are locked for this post.