View Single Post
 
Old 12-07-2013, 11:41 AM
PosseJohn PosseJohn is offline Windows 7 32bit Office 2010 32bit
Novice
 
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