Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Ben Ben is offline
external usenet poster
 
Posts: 54
Default BuildingBlock.Insert returns the wrong Range

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(WdBuildingBlockTy pes.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);
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert - file - range mgirving Microsoft Word Help 2 February 21st 07 04:56 PM
Macro to insert symbols results in wrong font wal Microsoft Word Help 2 January 18th 07 02:26 PM
Autotext returns wrong character Jeff Microsoft Word Help 1 July 5th 06 07:34 PM
VBA: For Each Cell in Range jumps out of range? Ed Tables 2 January 26th 06 05:51 PM
Word prints the wrong page in a range on a booklet formatted doc sciz Microsoft Word Help 4 May 21st 05 01:32 AM


All times are GMT +1. The time now is 11:56 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"