Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to send text to open MS Word document?

0 views
Skip to first unread message

Lee Eui Tae

unread,
Mar 4, 2008, 4:03:50 AM3/4/08
to
Hi.

I am using C++Builder 2007 now. I used to use C++Builder 6.

When I use C++Builder 6, I sent the text to open MS Word document by cord
like this:

#include <comobj.hpp>
//----------------------------------------------------------------------
void __fastcall TfrmSample::Button1Click(TObject *Sender)
{
Variant MSWord;
try
{
MSWord = GetActiveOleObject("Word.Basic");
}
catch (...)
{
Application->MessageBox("An error occurred.", "OK",
MB_OK|MB_ICONINFORMATION);
return;
}
MSWord.Exec(Procedure("Insert") << "Hello. This is the text to send to
MS Word.");
}
//----------------------------------------------------------------------

But, this cords don't work in the C++Builder 2007.
What's the matter?
Please answer my question.

Thanks.


0 new messages