New Method (ActiveX)

Creates a new document in SDI mode.

Supported platforms: Windows only

Signature

VBA:

RetVal = object.New(TemplateFileName)
object

Type: Document

The object this method applies to.

TemplateFileName

Access: Input-only

Type: String

The full path and file name of the template file.

Return Value (RetVal)

Type: Document

The newly created Document object.

Remarks

You should call the New method from the Document object only when working in SDI mode. When working in MDI mode, use the Add method on the Documents collection to create a new drawing.

Examples

VBA:

Sub Example_New()
    ' This example creates a new drawing based on the template ansi-a.dwt.
    ' Note: The path to the template file is included with its name. Adjust
    ' this path for your installation location before running this example.
    
    Dim templateFileName As String
    templateFileName = "c:\AutoCAD\template\ansi-a.dwt"
    
    If AcadApplication.preferences.System.SingleDocumentMode = True Then
        ThisDrawing.New templateFileName
    Else
        ThisDrawing.Application.Documents.Add templateFileName
    End If

End Sub

Visual LISP:

Not available