Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Saving a Word document as 97-2003 using Word 2007

Reply
 
Old 04-01-2009   #1 (permalink)
Martin


 
 

Saving a Word document as 97-2003 using Word 2007

Hello,

I'm making a VBS to build a Word document with pictures and text.
I have to save it in Word97-2003 format.

Example :
-----------------------------------------------------------------------------------------------------

Dim strCurPath
strCurPath = CreateObject
("Scripting.FileSystemObject").GetAbsolutePathName(".")

Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

objSelection.Font.Name = Arial
objSelection.Font.Size = 22
objSelection.Font.Underline = 1
objSelection.ParagraphFormat.Alignment = 1
objSelection.TypeText "Métrologie APPSMON"

objDoc.SaveAs strCurPath & "\TEST1.docx", 0
objDoc.SaveAs strCurPath & "\TEST2.doc", 0

objWord.Quit
-----------------------------------------------------------------------------------------------------

My problem is that TEST2.doc is not readable by Word2003, my script
just changed the extension, but the file format seems to be Word2007 :
(
The "0" comes from http://msdn.microsoft.com/en-us/library/bb238158.aspx
where it says that both wdFormatDocument and wdFormatDocument97
constant has a 0 value.

Any idea on how to save a a document in Word97-2003 format using
Word2007 and VBS ?

Thanks a lot for helping

My System SpecsSystem Spec
Old 04-01-2009   #2 (permalink)
T Lavedas


 
 

Re: Saving a Word document as 97-2003 using Word 2007

On Apr 1, 6:01*am, Martin <martin.bay...@xxxxxx> wrote:
Quote:

> Hello,
>
> I'm making a VBS to build a Word document with pictures and text.
> I have to save it in Word97-2003 format.
>
> Example :
> -----------------------------------------------------------------------------------------------------
>
> Dim strCurPath
> strCurPath = CreateObject
> ("Scripting.FileSystemObject").GetAbsolutePathName(".")
>
> Set objWord = CreateObject("Word.Application")
> objWord.Visible = True
> Set objDoc = objWord.Documents.Add()
> Set objSelection = objWord.Selection
>
> objSelection.Font.Name = Arial
> objSelection.Font.Size = 22
> objSelection.Font.Underline = 1
> objSelection.ParagraphFormat.Alignment = 1
> objSelection.TypeText "Métrologie APPSMON"
>
> objDoc.SaveAs strCurPath & "\TEST1.docx", 0
> objDoc.SaveAs strCurPath & "\TEST2.doc", 0
>
> objWord.Quit
> -----------------------------------------------------------------------------------------------------
>
> My problem is that TEST2.doc is not readable by Word2003, my script
> just changed the extension, but the file format seems to be Word2007 :
> (
> The "0" comes fromhttp://msdn.microsoft.com/en-us/library/bb238158.aspx
> where it says that both wdFormatDocument and wdFormatDocument97
> constant has a 0 value.
>
> Any idea on how to save a a document in Word97-2003 format using
> Word2007 and VBS ?
>
> Thanks a lot for helping
In the same Office reference under the Document Object SaveAs method's
documentation is the statement:

FileFormat Optional Variant

The format in which the document is saved. Can be any WdSaveFormat
constant. To save a document in another format, specify the
appropriate value for the SaveFormat property of the FileConverter
object.

Note the last sentence.

I run Office 2003 with the 2007 file converter installed. Recording a
macro to make the conversion to Word 97/2003 results in this like of
code just befor the save statement ...

Application.DefaultSaveFormat = "MSWord6RTFExp"

I would suggest you record a macro while manually stepping through a
file conversion SaveAs and go to school on the result.

HTH,

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
My System SpecsSystem Spec
Old 04-01-2009   #3 (permalink)
Martin


 
 

Re: Saving a Word document as 97-2003 using Word 2007

On 1 avr, 14:41, T Lavedas <tglba...@xxxxxx> wrote:
Quote:

> On Apr 1, 6:01*am, Martin <martin.bay...@xxxxxx> wrote:
>
>
>
Quote:

> > Hello,
>
Quote:

> > I'm making a VBS to build a Word document with pictures and text.
> > I have to save it in Word97-2003 format.
>
Quote:

> > Example :
> > -----------------------------------------------------------------------------------------------------
>
Quote:

> > Dim strCurPath
> > strCurPath = CreateObject
> > ("Scripting.FileSystemObject").GetAbsolutePathName(".")
>
Quote:

> > Set objWord = CreateObject("Word.Application")
> > objWord.Visible = True
> > Set objDoc = objWord.Documents.Add()
> > Set objSelection = objWord.Selection
>
Quote:

> > objSelection.Font.Name = Arial
> > objSelection.Font.Size = 22
> > objSelection.Font.Underline = 1
> > objSelection.ParagraphFormat.Alignment = 1
> > objSelection.TypeText "Métrologie APPSMON"
>
Quote:

> > objDoc.SaveAs strCurPath & "\TEST1.docx", 0
> > objDoc.SaveAs strCurPath & "\TEST2.doc", 0
>
Quote:

> > objWord.Quit
> > -----------------------------------------------------------------------------------------------------
>
Quote:

> > My problem is that TEST2.doc is not readable by Word2003, my script
> > just changed the extension, but the file format seems to be Word2007 :
> > (
> > The "0" comes fromhttp://msdn.microsoft.com/en-us/library/bb238158.aspx
> > where it says that both wdFormatDocument and wdFormatDocument97
> > constant has a 0 value.
>
Quote:

> > Any idea on how to save a a document in Word97-2003 format using
> > Word2007 and VBS ?
>
Quote:

> > Thanks a lot for helping
>
> In the same Office reference under the Document Object SaveAs method's
> documentation is the statement:
>
> FileFormat * * *Optional * * * *Variant
>
> The format in which the document is saved. Can be any WdSaveFormat
> constant. To save a document in another format, specify the
> appropriate value for the SaveFormat property of the FileConverter
> object.
>
> Note the last sentence.
>
> I run Office 2003 with the 2007 file converter installed. *Recording a
> macro to make the conversion to Word 97/2003 results in this like of
> code just befor the save statement ...
>
> * * Application.DefaultSaveFormat = "MSWord6RTFExp"
>
> I would suggest you record a macro while manually stepping through a
> file conversion SaveAs and go to school on the result.
>
> HTH,
>
> Tom Lavedas
> ***********http://there.is.no.more/tglbatch/
Word 2007 saving macro :
ActiveDocument.SaveAs FileName:="zerzerzerrzerzer.docx",
FileFormat:= _
wdFormatXMLDocument, LockComments:=False, Password:="",
AddToRecentFiles _
:=True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts _
:=False, SaveNativePictureFormat:=False, SaveFormsData:=False,
_
SaveAsAOCELetter:=False

Word 97/2003 saving macro :
ActiveDocument.SaveAs FileName:="azeazeaze.doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False

wdFormatDocument = 0 according to http://msdn.microsoft.com/en-us/library/bb238158.aspx
so my line objDoc.SaveAs strCurPath & "\TEST2.doc", 0 should save as
Word97/2003 but it doesn't
My System SpecsSystem Spec
Old 04-01-2009   #4 (permalink)
T Lavedas


 
 

Re: Saving a Word document as 97-2003 using Word 2007

On Apr 1, 9:00*am, Martin <martin.bay...@xxxxxx> wrote:
Quote:

> On 1 avr, 14:41, T Lavedas <tglba...@xxxxxx> wrote:
>
>
>
Quote:

> > On Apr 1, 6:01*am, Martin <martin.bay...@xxxxxx> wrote:
>
Quote:
Quote:

> > > Hello,
>
Quote:
Quote:

> > > I'm making a VBS to build a Word document with pictures and text.
> > > I have to save it in Word97-2003 format.
>
Quote:
Quote:

> > > Example :
> > > -----------------------------------------------------------------------------------------------------
>
Quote:
Quote:

> > > Dim strCurPath
> > > strCurPath = CreateObject
> > > ("Scripting.FileSystemObject").GetAbsolutePathName(".")
>
Quote:
Quote:

> > > Set objWord = CreateObject("Word.Application")
> > > objWord.Visible = True
> > > Set objDoc = objWord.Documents.Add()
> > > Set objSelection = objWord.Selection
>
Quote:
Quote:

> > > objSelection.Font.Name = Arial
> > > objSelection.Font.Size = 22
> > > objSelection.Font.Underline = 1
> > > objSelection.ParagraphFormat.Alignment = 1
> > > objSelection.TypeText "Métrologie APPSMON"
>
Quote:
Quote:

> > > objDoc.SaveAs strCurPath & "\TEST1.docx", 0
> > > objDoc.SaveAs strCurPath & "\TEST2.doc", 0
>
Quote:
Quote:

> > > objWord.Quit
> > > -----------------------------------------------------------------------------------------------------
>
Quote:
Quote:

> > > My problem is that TEST2.doc is not readable by Word2003, my script
> > > just changed the extension, but the file format seems to be Word2007 :
> > > (
> > > The "0" comes fromhttp://msdn.microsoft.com/en-us/library/bb238158.aspx
> > > where it says that both wdFormatDocument and wdFormatDocument97
> > > constant has a 0 value.
>
Quote:
Quote:

> > > Any idea on how to save a a document in Word97-2003 format using
> > > Word2007 and VBS ?
>
Quote:
Quote:

> > > Thanks a lot for helping
>
Quote:

> > In the same Office reference under the Document Object SaveAs method's
> > documentation is the statement:
>
Quote:

> > FileFormat * * *Optional * * * *Variant
>
Quote:

> > The format in which the document is saved. Can be any WdSaveFormat
> > constant. To save a document in another format, specify the
> > appropriate value for the SaveFormat property of the FileConverter
> > object.
>
Quote:

> > Note the last sentence.
>
Quote:

> > I run Office 2003 with the 2007 file converter installed. *Recording a
> > macro to make the conversion to Word 97/2003 results in this like of
> > code just befor the save statement ...
>
Quote:

> > * * Application.DefaultSaveFormat = "MSWord6RTFExp"
>
Quote:

> > I would suggest you record a macro while manually stepping through a
> > file conversion SaveAs and go to school on the result.
>
Quote:

> > HTH,
>
Quote:

> > Tom Lavedas
> > ***********http://there.is.no.more/tglbatch/
>
> Word 2007 saving macro :
> * * ActiveDocument.SaveAs FileName:="zerzerzerrzerzer.docx",
> FileFormat:= _
> * * * * wdFormatXMLDocument, LockComments:=False, Password:="",
> AddToRecentFiles _
> * * * * :=True, WritePassword:="", ReadOnlyRecommended:=False,
> EmbedTrueTypeFonts _
> * * * * :=False, SaveNativePictureFormat:=False, SaveFormsData:=False,
> _
> * * * * SaveAsAOCELetter:=False
>
> Word 97/2003 saving macro :
> * * ActiveDocument.SaveAs FileName:="azeazeaze.doc", FileFormat:=_
> * * * * wdFormatDocument, LockComments:=False, Password:="",
> AddToRecentFiles:= _
> * * * * True, WritePassword:="", ReadOnlyRecommended:=False,
> EmbedTrueTypeFonts:= _
> * * * * False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
> * * * * SaveAsAOCELetter:=False
>
> wdFormatDocument = 0 according tohttp://msdn.microsoft.com/en-us/library/bb238158.aspx
> so my line objDoc.SaveAs strCurPath & "\TEST2.doc", 0 should save as
> Word97/2003 but it doesn't
Sorry, I forgot to mention that as you record the macro it is
important that you select the Save Options and then select the
translation that you want to execute as you save the document. It is
a separate dialog that should be available from the SaveAs dialog
window (at least it is in 2003). This changes what is recorded in the
macro - to include the FileConverter part of the process.

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Saving Documents Created in Word 2007 to be Compatible with Word 2003 Microsoft Office
Converting Word 97-2003 document to Word 2007 Vista General
Send Word document by email from Word 2003 not working with WLM Live Mail
accidentally moved a MS Word document,now it dissapears everytime i open any word document Vista General
Creating Word document of Word 97-2003 file type on the New menu in Vista Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46