BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Word / save document

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Nico Callewaert
Guest





PostPosted: Mon Sep 13, 2004 10:31 am    Post subject: Word / save document Reply with quote




Hi,

I'm unable to save a word document, because of the following
error : "Method not supported by automation object" (or
something like that.

Word.FileSaveAs('c:Me.rtf', 6); <---- ERROR

try
Word := CreateOleObject('Word.Application');
Word.Visible := True;
bWordCreated := True;
except
bWordCreated := False;
end;

if bWordCreated then
begin
Word.Documents.Add(EmptyParam, EmptyParam);
Word.Selection.Paste;
Word.FileSaveAs('c:Me.rtf', 6);
end;

Any idea ?

Many thanks,

Nico Callewaert
Back to top
David Harper
Guest





PostPosted: Mon Sep 13, 2004 11:12 am    Post subject: Re: Word / save document Reply with quote



"Nico Callewaert" <nico_callewaert (AT) hotmail (DOT) com> wrote

Quote:

Hi,

I'm unable to save a word document, because of the following
error : "Method not supported by automation object" (or
something like that.

Word.FileSaveAs('c:Me.rtf', 6); <---- ERROR

Try:

Word.ActiveDocument.SaveAs('c:Me.rtf');

- David Harper


Back to top
Nico Callewaert
Guest





PostPosted: Mon Sep 13, 2004 11:25 am    Post subject: Re: Word / save document Reply with quote




Thanks David, solved !

Best regards, Nico

"David Harper" <dharper (AT) houston (DOT) rr.com> wrote:
Quote:
"Nico Callewaert" <nico_callewaert (AT) hotmail (DOT) com> wrote in message
news:414576e6$1 (AT) newsgroups (DOT) borland.com...

Hi,

I'm unable to save a word document, because of the following
error : "Method not supported by automation object" (or
something like that.

Word.FileSaveAs('c:Me.rtf', 6); <---- ERROR

Try:

Word.ActiveDocument.SaveAs('c:Me.rtf');

- David Harper



Back to top
Deborah Pate (TeamB)
Guest





PostPosted: Mon Sep 13, 2004 11:39 am    Post subject: Re: Word / save document Reply with quote

< Word.FileSaveAs('c:Me.rtf', 6); <---- ERROR
Quote:


That's an old-style Word Basic command, not used in VBA,
i.e. in Word 97+ - though if you really want to use
WordBasic commands, you can:

Word.WordBasic.FileSaveAs('c:Me.rtf', 6);

The normal VBA method is
Word.ActiveDocument.SaveAs('c:Me.rtf');

You can check the VBA help for Word on your Office CD to
see all the possible parameters.

--
Deborah Pate (TeamB) http://delphi-jedi.org

TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.