🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #610

How to send text to open MS Word document?

#610
From: Lee Eui Tae
Date: Thu, 06 Mar 2008 07:35
32 lines
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.
Technical Details
Message-ID: <47cf9eae@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,628da6c9e42ebc83,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Lee Eui Tae" <wait4him@paran.com>
From: "Lee Eui Tae" <wait4him@paran.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How to send text to open MS Word document?
Date: Thu, 6 Mar 2008 16:35:14 +0900
Lines: 35
Organization: Sahmyook Foods
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 210.183.132.7
Message-ID: <47cf9eae@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1204788910 210.183.132.7 (5 Mar 2008 23:35:10 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail