Skip to Content

How to know whether document is only printed or only viewed as print preview in EXCEL?

Dear All,

We are trying to build a control on printing of document, by setting the indicator for the record as printed once user prints the record.

But, is there any way to find out if user has only done print preview or actually printed the document?

In SAP Smart Forms, there is a flag OUTPUTDONE in parameter JOB_OUTPUT_INFO, which indicate whether document is printed or not. But we print document by using EXCEL file, OLE.

As description in MSDN ( https://msdn.microsoft.com/en-us/vba/excel-vba/articles/workbook-object-excel) , it seems there is not "printed" property in the wookbook object. So, how to know whether document is only printed or only viewed as print preview in EXCEL?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 07 at 06:12 PM

    I think this is either not possible, or else it won't be reliable. What if someone does a "Save as" and prints it later? Or does an Excel to PDF output?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 18 at 04:24 PM

    Zhe,

    I am not an expert in Excel. From the link you shared you could maybe use BuiltinDocumentProperties to retrieve the property called "Last Printed". Not sure if this will help and not sure how you can pass this back to SAP.

    As an alternative, on return from Print Preview, you could ask the user if the document was printed or not (in a popup). Not the best solution but an option.

    Che

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Che,

      The "Last Printed" property will be updated when program calls method "PrintPreview", and this calling is nessesary....

      By the disscusion with Mike, I have realized that it is unreliabe to control the process by OLE.

      Thanks.