Although I took it from 2003, the SaveAs4 should be the same, otherwise they would have made it SaveAs5. Here is what I have:
retval = ModelDoc2.SaveAs4 ( Name, Version, Options, &Errors, &Warnings )
Input:
(BSTR) Name
New name of the document. The file extension indicates any conversion that should be performed (for example, "Part1.igs" to save to IGES)
Input:
(long) Version
Version information for this save as defined in swSaveAsVersion_e
Input:
(long) Options
Option indicating how to save the document as defined in swSaveAsOptions_e
Output:
(long) Errors
Errors that caused the save to fail as defined in swFileSaveError_e
Output:
(long) Warnings
Warnings or extra information generated during the save operation as defined in swFileSaveWarning_e
Output:
(BOOL) retval
TRUE if the save is successful, FALSE if not
From swConst:
Public Enum swSaveAsVersion_e
swSaveAsCurrentVersion = 0 ' default
swSaveAsSW98plus = 1 ' save SW model in SW98plus model format - NO LONGER SUPPORTED
swSaveAsFormatProE = 2 ' save Sw part as Pro/E format .prt/.asm extension (not as Sw .prt/.asm)
End Enum
Public Enum swSaveAsOptions_e
swSaveAsOptions_Silent = &H1 ' Save document silently or not
swSaveAsOptions_Copy = &H2 ' Save document as a copy or not
swSaveAsOptions_SaveReferenced = &H4 ' Save referenced documents or not (drawings and parts only)
swSaveAsOptions_AvoidRebuildOnSave = &H8 ' Avoid rebuild on Save or SaveAs, if swSaveAsOptions_Silent
swSaveAsOptions_UpdateInactiveViews = &H10 ' Update views of inactive sheets, if swSaveAsOptions_Silent
swSaveAsOptions_OverrideSaveEmodel = &H20 ' Override system setting for saving emodel data of document
swSaveAsOptions_SaveEmodelData = &H40 ' If OverrideSaveEmodel is True, use this as the value instead
End Enum
Public Enum swFileSaveError_e
swGenericSaveError = &H1
swReadOnlySaveError = &H2
swFileNameEmpty = &H4 ' The filename must not be empty
swFileNameContainsAtSign = &H8 ' The filename can not contain an '@' character
swFileLockError = &H10
swFileSaveFormatNotAvailable = &H20 ' The save as file type is not valid
swFileSaveWithRebuildError = &H40 ' NO LONGER USED IN SW2001PLUS, moved to swFileSaveWarning_e
swFileSaveAsDoNotOverwrite = &H80 ' The user chose not to overwrite an existing file
swFileSaveAsInvalidFileExtension = &H100 ' The file extension differs from the Sw document type
End Enum
Public Enum swFileSaveWarning_e
swFileSaveWarning_RebuildError = &H1 ' The file was saved, but with a rebuild error
swFileSaveWarning_NeedsRebuild = &H2 ' The file was saved, but needs a rebuild
swFileSaveWarning_ViewsNeedUpdate = &H4 ' The file was saved, but views of inactive sheets need updating
End Enum
Messy, but that's it.
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.