User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 402,053 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,448 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 309 | Replies: 0
Reply
Join Date: Sep 2007
Posts: 10
Reputation: drichird is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
drichird drichird is offline Offline
Newbie Poster

VBA to save word doc in new 2007 format?

  #1  
Jul 18th, 2008
Here is some old VBA code inside a Word 2003 document to open and then save a word document:

    Documents.Open FileName:=docFileName, ConfirmConversions:=True, _
        ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
        PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
        WritePasswordTemplate:="", Format:=wdOpenFormatAuto

       'do stuff to the opened file here...

        ActiveDocument.SaveAs _
             FileName:=docFileName, _
             FileFormat:=wdFormatDocument, _
             LockComments:=False, _
             Password:="", _
             AddToRecentFiles:=True, _
             WritePassword:="", _
             ReadOnlyRecommended:=False, _
             EmbedTrueTypeFonts:=False, _
             SaveNativePictureFormat:=False, _
             SaveFormsData:=False, _
            SaveAsAOCELetter:=False

I ported the code to a word 2007 document, but now if I open a word 2007 doc the save code still saves it in the old format even if I specify a docx extension. What are the new parameters for FileFormat:= ..... now that MS is using the new open XML format. Can I save as either new/old format? Are there any other pitfalls to file I/O with the new MS open format?

Thanks ahead, for any help
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 11:54 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC