PC Review


Reply
Thread Tools Rate Thread

BuildingBlock.Insert returns the wrong Range

 
 
=?Utf-8?B?YmVu?=
Guest
Posts: n/a
 
      25th Sep 2007
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);
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Vlookup returns #N/A when Range is 'false', but returns valueswhen 'true' Pete_UK Microsoft Excel Worksheet Functions 1 8th Mar 2010 02:36 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) =?Utf-8?B?RWRtdW5k?= Microsoft Excel Misc 8 4th Oct 2007 12:13 PM
Inserting a buildingblock item into an email programatically =?Utf-8?B?TWlrYWVs?= Microsoft Outlook VBA Programming 1 5th Mar 2007 06:41 AM
Shape ControlFormat.LinkedCell returns wrong Address for named range - BUG bowlegtroy@hotmail.com Microsoft Excel Programming 10 14th Jul 2006 03:05 PM
Range.Find returns cell outside of range when range set to single cell Frank Jones Microsoft Excel Programming 12 10th Jun 2004 04:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:54 AM.