TempFileExtension Property (ActiveX)

Specifies the extension for temporary files.

Supported platforms: Windows only

Signature

VBA:

object.TempFileExtension
object

Type: PreferencesOpenSave

The object this property applies to.

Property Value

Read-only: No

Type: String

This string must be between one and three characters inclusive.

Remarks

The default value for this property is ac$.

The temporary file extension is a one to three character extension that is used for temporary files. In a multiuser environment, you can avoid confusion by specifying a different name for each user.

Examples

VBA:

Sub Example_TempFileExtension()
    ' This example returns the current setting of
    ' TempFileExtension. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currTempFileExtension As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current TempFileExtension value
    currTempFileExtension = preferences.OpenSave.TempFileExtension
    MsgBox "The current value for TempFileExtension is " & preferences.OpenSave.TempFileExtension, vbInformation, "TempFileExtension Example"
    
    ' Change the value for TempFileExtension
    preferences.OpenSave.TempFileExtension = "@@@"
    MsgBox "The new value for TempFileExtension is " & preferences.OpenSave.TempFileExtension, vbInformation, "TempFileExtension Example"
    
    ' Reset TempFileExtension to its original value
    preferences.OpenSave.TempFileExtension = currTempFileExtension
    MsgBox "The TempFileExtension value is reset to " & preferences.OpenSave.TempFileExtension, vbInformation, "TempFileExtension Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_TempFileExtension()
    ;; This example returns the current setting of
    ;; TempFileExtension. It then changes the value, and finally
    ;; it resets the value back to the original setting.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Retrieve the current TempFileExtension value
    (setq currTempFileExtension (vla-get-TempFileExtension (vla-get-OpenSave preferences)))
    (alert (strcat "The current value for TempFileExtension is " currTempFileExtension))
    
    ;; Change the value for TempFileExtension
    (vla-put-TempFileExtension (vla-get-OpenSave preferences) "@@@")
    (alert (strcat "The new value for TempFileExtension is " (vla-get-TempFileExtension (vla-get-OpenSave preferences))))
    
    ;; Reset TempFileExtension to its original value
    (vla-put-TempFileExtension (vla-get-OpenSave preferences) currTempFileExtension)
    (alert (strcat "The TempFileExtension value is reset to " (vla-get-TempFileExtension (vla-get-OpenSave preferences))))
)