C
ccccoder
I had a plugin for Excel written in C++, with an event sink. Another
functionality request to add was to validate certain data before printing the
workbook. If the data can not be validated correctly, then the print job must
be canceled.
The event sink can get the print event correctly in the Invoke() method
(inherited from IDispatch), but how can I cancel the print job? In VBA, you
can set the cancel flag to true in Workbook_BeforePrint subroutine, but there
does not seem to have an equivalent in C++.
The question is, how can I cancel the print job from inside the Invoke()
function, or at least, tell Excel that it should not continue with printing?
Thanks in advance
functionality request to add was to validate certain data before printing the
workbook. If the data can not be validated correctly, then the print job must
be canceled.
The event sink can get the print event correctly in the Invoke() method
(inherited from IDispatch), but how can I cancel the print job? In VBA, you
can set the cancel flag to true in Workbook_BeforePrint subroutine, but there
does not seem to have an equivalent in C++.
The question is, how can I cancel the print job from inside the Invoke()
function, or at least, tell Excel that it should not continue with printing?
Thanks in advance