find and replace Word Textboxes with VC++

T

Thomas Noone

Hi!

I'm trying to find and replace text in Word using automation.
My current routine doesn't work with textboxes.

Has anybody solved this problem using VC++?
I've been wasting hours trying to figure out, how to convert the simple VB
code to VC++ - thanks to the great documentation.

Any help (or better example) is greatly appreciated!

Thanks,

Thomas


Range rngDoc;
rngDoc = oDoc.GetContent();

Find fn = rngDoc.GetFind();
COleVariant vt1, vt2, vtUnit, vtExtend;
vt1 = strReplace;
vt2 = strReplaceWith;

// Replace
while(fn.Execute(vt1,
vtTrue,
vtTrue,
vtFalse,
vtFalse,
vtFalse,
vtTrue,
vtTrue,
vtOptional,
vt2,
vtFindContinue))
{
}
 

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