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.