Microsoft Office Forums Problems With Using Different Office Versions

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2013, 11:41 AM
PosseJohn PosseJohn is offline Problems With Using Different Office Versions Windows 7 32bit Problems With Using Different Office Versions Office 2010 32bit
Novice
Problems With Using Different Office Versions
 
Join Date: Jul 2011
Posts: 20
PosseJohn is on a distinguished road
Default Problems With Using Different Office Versions

I have a document that is shared by users using both Office 2007 and 2010. As such, with 2010, the SaveAs has been depreciated and I need to use SaveAs2.

When I try to 'trap' this, I receive an error on the Office 2007 machines, as Office 2007 doesn't recognize SaveAs2 in the code.



Here's what I have in the Document_Close event:

Code:
    With ThisDocument
        Select Case Application.Version
            Case "12.0"
                'Save the document
                .Save
                'Save the document as ARCHIVE
                .SaveAs FileName:="\\...\Unit3 Archive\Doc2" & Format(Now(), "yymmdd hh:mm"), _
                        FileFormat:=wdFormatXMLDocument, _
                        LockComments:=True, _
                        Password:="", _
                        AddToRecentFiles:=False, _
                        WritePassword:="xxxx", _
                        ReadOnlyRecommended:=True, _
                        EmbedTrueTypeFonts:=True, _
                        SaveNativePictureFormat:=False, _
                        SaveFormsData:=False, _
                        SaveAsAOCELetter:=False
            Case "14.0"
                'Save the document
                .Save
                'Save the document as ARCHIVE
                .SaveAs2 FileName:="\\...\Unit3 Archive\Doc2" & Format(Now(), "yymmdd hh:mm"), _
                        FileFormat:=wdFormatXMLDocument, _
                        LockComments:=True, _
                        Password:="", _
                        AddToRecentFiles:=False, _
                        WritePassword:="xxxx", _
                        ReadOnlyRecommended:=True, _
                        EmbedTrueTypeFonts:=True, _
                        SaveNativePictureFormat:=False, _
                        SaveFormsData:=False, _
                        SaveAsAOCELetter:=False, _
                        CompatibilityMode:=14
        End Select
    End With
Reply With Quote
  #2  
Old 12-07-2013, 01:52 PM
macropod's Avatar
macropod macropod is offline Problems With Using Different Office Versions Windows 7 32bit Problems With Using Different Office Versions Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Although, as you say, the SaveAs has been deprecated in Office 2010, that doesn't mean you can't still use the SaveAs method.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 12-07-2013, 02:21 PM
PosseJohn PosseJohn is offline Problems With Using Different Office Versions Windows 7 32bit Problems With Using Different Office Versions Office 2010 32bit
Novice
Problems With Using Different Office Versions
 
Join Date: Jul 2011
Posts: 20
PosseJohn is on a distinguished road
Default Problems With Using Different Office Versions

I have determined why this was failing (GCE - Gross Conceptual Error) on my part.

By including the "SaveAs2" in a module that is compiled during use, it will cause an error.

I have moved the "SaveAs" and "SaveAs2" portions to other routines that are called upon, based on the Application.Version.

I also overlooked the ":" in the file name, as it is not allowed in the naming of a file.
Reply With Quote
  #4  
Old 12-07-2013, 06:47 PM
macropod's Avatar
macropod macropod is offline Problems With Using Different Office Versions Windows 7 32bit Problems With Using Different Office Versions Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by PosseJohn View Post
I have moved the "SaveAs" and "SaveAs2" portions to other routines that are called upon, based on the Application.Version.
Fine but, as I said, your can use the Word 2007 'SaveAs' code for both Word 2007 and 2010.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 12-09-2013, 11:33 AM
PosseJohn PosseJohn is offline Problems With Using Different Office Versions Windows 7 32bit Problems With Using Different Office Versions Office 2010 32bit
Novice
Problems With Using Different Office Versions
 
Join Date: Jul 2011
Posts: 20
PosseJohn is on a distinguished road
Default

Yes, SaveAs is still available, but only if you wish to save it as a new name, does not allow you to set the following attributes like it used to:

FileFormat
LockComments
Password
AddToRecentFiles
WritePassword
ReadOnlyRecommended
EmbedTrueTypeFonts
SaveNativePictureFormat
SaveFormsData
SaveAsAOCELetter

So for that reason, I needed to resolve the way I did.

Thank you for your responses though, help is much appreciated.

Merry Christmas!
Reply With Quote
  #6  
Old 12-09-2013, 03:02 PM
macropod's Avatar
macropod macropod is offline Problems With Using Different Office Versions Windows 7 32bit Problems With Using Different Office Versions Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,525
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by PosseJohn View Post
Yes, SaveAs is still available, but only if you wish to save it as a new name, does not allow you to set the following attributes like it used to:
Umm, yes it does. There mere fact they don't appear in the VBA intellisense doesn't mean they've gone away; after all, if that were the case, any code that was brought over to Word 2010 from a previous version would break. That's not what MS has done.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems With Using Different Office Versions How do you save different 'versions' onto the same file (Office 2007) kholmesmcgov Word 2 11-17-2013 01:45 PM
Two versions of MS Office Glenwvdp Office 1 11-05-2012 02:02 PM
Multiple versions of Office on the same network. whatrudoingdave Office 1 04-30-2012 03:36 PM
using 2 office versions but automaticly chose the old one garfy Office 0 07-15-2010 04:48 AM
Problems With Using Different Office Versions MS Office 2007 Versions daufoi Office 3 01-08-2010 12:51 PM


All times are GMT -7. The time now is 07:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft