SaveAs Method (ActiveX)

Saves the document to a specified file; no longer supported for menu groups.

Supported platforms: Windows only

Signature - Document

VBA:

object.SaveAs FileName [, FileType] [, SecurityParams]
object

Type: Document

The object this method applies to.

FileName

Access: Input-only

Type: String

The full path and file name, or valid URL address, for the file. The active document takes on the new name.

FileType

Access: Input-only; optional

Type: AcSaveAsType enum

  • acR12_dxf: AutoCAD R12 DXF (*.dxf)
  • acR14_dwg: AutoCAD R14 DWG (*.dwg)
  • ac2000_dwg: AutoCAD 2000 DWG (*.dwg)
  • ac2000_dxf: AutoCAD 2000 DXF (*.dxf)
  • ac2000_Template: AutoCAD 2000 Drawing Template File (*.dwt)
  • ac2004_dwg: AutoCAD 2004 DWG (*.dwg)
  • ac2004_dxf: AutoCAD 2004 DXF (*.dxf)
  • ac2004_Template: AutoCAD 2004 Drawing Template File (*.dwt)
  • ac2007_dwg: AutoCAD 2007 DWG (*.dwg)
  • ac2007_dxf: AutoCAD 2007 DXF (*.dxf)
  • ac2007_Template: AutoCAD 2007 Drawing Template File (*.dwt)
  • ac2010_dwg: AutoCAD 2010 DWG (*.dwg)
  • ac2010_dxf: AutoCAD 2010 DXF (*.dxf)
  • ac2010_Template: AutoCAD 2010 Drawing Template File (*.dwt)
  • ac2013_dwg: AutoCAD 2013 DWG (*.dwg)
  • ac2013_dxf: AutoCAD 2013 DXF (*.dxf)
  • ac2013_Template: AutoCAD 2013 Drawing Template File (*.dwt)
  • acNative: A synonym for the latest drawing release. In this release, this value equals ac2013_dwg.
SecurityParams

Access: Input-only; optional

Type: Variant (a SecurityParams object)

Security settings used to specify a digital signature for the drawing.

Note: Starting with AutoCAD-2016 based products, the ability to password protect a drawing file has been discontinued. Trying to password protect a drawing file in an AutoCAD-2016 based product results in an error. The security parameters related to password protection must be removed to save a drawing file.

Signature - MenuGroup

VBA:

object.SaveAs MenuFileName, MenuFileType
object

Type: MenuGroup

The object this method applies to.

MenuFileName

Access: Input-only

Type: String

The full path and file name for the menugroup to be saved to.

MenuFileType

Access: Input-only

Type: AcMenuFileType enum

  • acMenuFileCompiled
  • acMenuFileSource

Return Value (RetVal)

No return value.

Remarks

The default file type for documents is ac2013_dwg. The value acR14_dxf is obsolete.

Documents can be saved only as files with the extensions indicated above. To save a document in a different file type, use the Export method.

When saving to a secure URL, a dialog box prompts the user for the necessary password information. Message boxes appear if the user has not suppressed this activity in the browser.

Menu groups cannot be saved in AutoCAD 2006 and later releases. This method will be removed from the MenuGroup object in a future release.

Examples

VBA:

Sub Example_SaveAs()
    ' The following example saves current drawing as "test.dwg"
    
    ThisDrawing.SaveAs "test.dwg"
    
End Sub

Visual LISP:

(defun c:Example_SaveAs()
    ;; The following example saves current drawing as "test.dwg"
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (vla-SaveAs doc "test.dwg")
)