I'm attempting to insert a building block into a word document using the
BuildingBlock.Insert method and then use the Range object returned to apply
number formatting. However the range object returned only covers the first
paragraph in the building block. Has anyone else encountered this situation
and how did you get around it? Here's a segment of the code:
BuildingBlock bb =
template.BuildingBlockTypes.Item(WdBuildingBlockTypes.wdTypeCustom1).Categories.Item(ref buildingBlockCategory).BuildingBlocks.Item(ref buildingBlockName) ;
object rangeStart = m_WordDocument.Sections.Last.Range.End -
1;
object rangeEnd = m_WordDocument.Sections.Last.Range.End - 1;
Range insertedRange = bb.Insert(
m_WordDocument.Range(ref rangeStart,ref rangeEnd),
ref richText);
|