PutText removes twice the size in ms publisher 2007

V

Viswa

I am trying to replace the macro defined in a text box with text
programatically (VC++) with the following method.
In Publisher::TextRangePtr->PutText
This workes fine in ms publisher 2003 but in ms publisher 2007 removes twice
the size.

Following are the steps i followed

Publisher::TextRangePtr &TRange
TRange->Collapse( Publisher::pbCollapseStart );
TRange->MoveStart( Publisher::pbTextUnitCharacter, istart);
TRange->MoveEnd( Publisher::pbTextUnitCharacter, iend - istart);

CString szDbgOrigText = (LPCTSTR)TRange->GetText(); // I have correct data

// replace the text with its value
TRange->PutText((_bstr_t)szValue); // At the end its find. But string at the
begining and moddle removed teh twice the bytes

// expand the text area to the entire "story"
TRange->Expand( Publisher::pbTextUnitStory );

CString szDbgNewText = (LPCTSTR)TRange->GetText(); Shows me the text by
rmoving the twice teh size i.e (iend - istart) * 2

It works find in 2003 but not sure whats teh problem with 2007.

Any help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top