 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nico Callewaert Guest
|
Posted: Mon Sep 13, 2004 10:31 am Post subject: Word / save document |
|
|
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
|
Posted: Mon Sep 13, 2004 11:12 am Post subject: Re: Word / save document |
|
|
"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
|
Posted: Mon Sep 13, 2004 11:25 am Post subject: Re: Word / save document |
|
|
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
|
Posted: Mon Sep 13, 2004 11:39 am Post subject: Re: Word / save document |
|
|
<
Word.FileSaveAs('c:Me.rtf', 6); <---- ERROR
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 |
|
 |
|
|
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
|
|