Thread View: borland.public.cppbuilder.nativeapi
1 messages
1 total messages
Started by Lee Eui Tae
Thu, 06 Mar 2008 07:35
How to send text to open MS Word document?
Author: Lee Eui Tae
Date: Thu, 06 Mar 2008 07:35
Date: Thu, 06 Mar 2008 07:35
32 lines
1805 bytes
1805 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads