Problem: ArcMap closes when using VBA to specify IArcPressPrinter::Driver


ArcMap will crash when using Visual Basic for Applications (VBA) code to specify a driver on the IArcPressPrinter interface.


The IPrinter::Paper object was not set up correctly.

Solution or Workaround

This problem is addressed in ArcGIS 8.1.2.

The following code snippet demonstrates how to set up the IPrinter::Paper object before specifying a driver.

Dim pApp as IApplication
Set pApp = Application

Dim pMxApp as IMxApplication
Set pMxApp = pApp

Dim pPrinter as IPrinter
Set pPrinter = New ArcPressPrinter

Dim pArcPressPrinter as IArcPressPrinter
Set pArcPressPrinter = pPrinter

Set pPrinter.Paper = pMxApp.Paper

pArcPressPrinter.Driver = <member of esriArcPressDriverPrinters>