PrintFile Example

Using Programming Languages other than VBA

Sub Example_PrintFile()
	' This example returns the current setting of
	' PrintFile. It then changes the value, and finally
	' it resets the value back to the original setting.

	Dim preferences As AcadPreferences
	Dim currPrintFile As String
	Dim newPrintFile As String

	Set preferences = ThisDrawing.Application.preferences

	' Retrieve the current PrintFile value
	currPrintFile = preferences.Files.PrintFile
	MsgBox "The current value for PrintFile is " & currPrintFile, vbInformation, "PrintFile Example"

	' Change the value for PrintFile
	newPrintFile = "TestPrintFile.plt"
	preferences.Files.PrintFile = newPrintFile
	MsgBox "The new value for PrintFile is " & newPrintFile, vbInformation, "PrintFile Example"

	' Reset PrintFile to its original value
	preferences.Files.PrintFile = currPrintFile
	MsgBox "The PrintFile value is reset to " & currPrintFile, vbInformation, "PrintFile Example"
End Sub