Settings Property
This property sets or returns a string containing binary data that specifies printer settings such as the paper size and source, portrait or landscape orientation, margins, and the name of the output device.
PrintInfo.Settings= string
Read/Write at run time. Not available at design time.
Property applies to PrintInfo object.
By default, this property returns an empty string, and the current settings for the system default printer are used.
When the PageSetup method is called, and the user selects OK to confirm the options in the page setup dialog, the specified printer settings are stored in the Settings property as a string of binary data. This string is used by the PrintData and PrintPreview methods during printer initialization.
You can use this property to save and restore user preferences specified in the page setup dialog. For example, the following code saves the Settings property to a binary file:
Dim Settings() As Byte
Open "pagesetup.dat" For Random Access Write As #1 Len = 4096
Settings = TDBList1.PrintInfo.Settings
Put #1, , Settings
Close #1
Similarly, the following code reads the contents of the file into a byte array, which is then assigned to the Settings property.
Dim Settings() As Byte
Open "pagesetup.dat" For Random Access Read As #1 Len = 4096
Get #1, , Settings
Close #1
TDBList1.PrintInfo.Settings = Settings
Assigning an empty string to the Settings property restores the default printer settings.
Note: The internal format used by the Settings string is not available. You cannot access an individual attribute such as the printer name; all page setup settings must be saved and restored as a unit.
See Also