Board index » delphi » Saving Word 97 to Word 95

Saving Word 97 to Word 95

Hi forums,

I really need your help, I have a problem like this....

I'm using TOLEContainer to embed microsoft word into my program, I open ms
word document with CreateObjectFromFile(Filename, False) and create a new
file with CreateObject('Word.Document', False).

For one purpose I have to save this Word97 document into Word 6/95 document
using SaveAsDocument(Filename). How can I save this Document so the format
could be in Word 6/95.

Thanks in advance,
-Wayan-

 

Re:Saving Word 97 to Word 95


<<I Wayan Saryada:
 For one purpose I have to save this Word97 document into
Word 6/95 document using SaveAsDocument(Filename).
How can I save this Document so the format could be in
Word 6/95.

Quote

You have to call Word's Document.SaveAs method with
the appropriate FileFormat parameter. I just recorded
myself doing this as a macro, and the FileFormat was
108 - but I should check on your system, because Word
97 had a few problems saving into earlier formats - you
may have different file converters.

Deborah Pate

Re:Saving Word 97 to Word 95


I Found on my system the FileFormat was 101 (does the format different in
every system).

Do you have any code for it, because now I'm using
TOleContainer.SaveAsDocument(FileName) to save it.

Regards,
Wayan

Quote
Deborah Pate <D...@djpate.freeserve.co.uk> wrote in message

news:811tgf$coj4@forums.borland.com...
Quote
> You have to call Word's Document.SaveAs method with
> the appropriate FileFormat parameter. I just recorded
> myself doing this as a macro, and the FileFormat was
> 108 - but I should check on your system, because Word
> 97 had a few problems saving into earlier formats - you
> may have different file converters.

> Deborah Pate

Re:Saving Word 97 to Word 95


<<I Wayan Saryada:
 I Found on my system the FileFormat was 101 (does the format
different in
every system).

Do you have any code for it, because now I'm using
TOleContainer.SaveAsDocument(FileName) to save it.

Quote

  Word := OleContainer1.OleObject.Application;
  Word.ActiveDocument.SaveAs(Filename := 'trythis.doc', FileFormat :=
101);

I think when Word 97 first came out it saved in RTF format
when told to save in an earlier word format, and since then
there have been a few converter updates (since users were
not happy with this <g>). So it's a problem to know which
your users will have - especially as there may be different
ones for different locales. I don't seem to have one with a
value of 101, for example. You may want to check the
relevant converter is installed first, with code like this:

  for i := 1 to Word.FileConverters.Count do
     if Word.FileConverters.Item(i).Classname = 'MSWord6Exp' then
       ShowMessage('Converter is installed');

Deborah Pate

Re:Saving Word 97 to Word 95


It seems to work, I need another help how can I open a document in word such
as RTF or Text file using TOleContainer.

This is how I do it now:

OleContainer1.CreateObjectFromFile(FileName);

So it can only open Word Document; because my OleContainer is set to
Word.Document.

I want to make it like the way you tell me how to save it, could it be like
the one below?

OleContainer1.CreateObject(???????);
Word := OleContainer1.OleObject.Application;
Word.Documents.Open(FileName := FileName);

Best regards,
Wayan

Quote
Deborah Pate <D...@djpate.freeserve.co.uk> wrote in message

news:814apb$26d13@forums.borland.com...
Quote
> I think when Word 97 first came out it saved in RTF format
> when told to save in an earlier word format, and since then
> there have been a few converter updates (since users were
> not happy with this <g>). So it's a problem to know which
> your users will have - especially as there may be different
> ones for different locales. I don't seem to have one with a
> value of 101, for example. You may want to check the
> relevant converter is installed first, with code like this:

>   for i := 1 to Word.FileConverters.Count do
>      if Word.FileConverters.Item(i).Classname = 'MSWord6Exp' then
>        ShowMessage('Converter is installed');

> Deborah Pate

Re:Saving Word 97 to Word 95


<<I Wayan Saryada:
 OleContainer1.CreateObject(???????);

Quote

Try
  OleContainer1.CreateLinkToFile('Doc.rtf',False);

Deborah Pate

Other Threads