How to get the original number of print copies form Application.DocumentBeforePrint event? (Word VBA)

Roland Filip 0 Reputation points
2025-02-21T10:39:13.2366667+00:00

Hi!

I'd like to know if there is a way to get the original number of print copies which was set up in the Word Application File Menu/Print form by the user.

Image

I know there are some workarounds about it on the net yet, like this one:

https://answers.microsoft.com/en-us/msoffice/forum/all/word-show-on-a-printed-document-the-number-of/0477c81e-0e0d-41b9-9497-6041cc2055dc

but none of those are real solution, they only bypass the problem i.e. they just cancel the original print job in the .DocumentBeforePrint eventhandler by set the Cancel = Ture and after it ask again the number of copies in an inputbox or .Display the built in Application.Dialogs(wdDialogFilePrint) and then get number of copies from that.

The main problem with above mentioned workarounds that the user must set up the same setting (least the count) and/or other settings too two times which upsetting them.

That information clearly must reachable by the system somewhere/somehow but i cant find where and how.

I guess the event handler's Doc object variable should contain it somewhere (maybe through it's nested Application or Windows objects, etc.)

But if there really no any VBA object containing this information maybe there is a Win API or other implementable function likes VB.NET System.Printing.PrintTicket.CopyCount which can retrieve this information.

(If System.Printing.PrintTicket.CopyCount really can be a solution for my problem, my issue with it is that the ReachFramework.dll library which contain it not referenceable.)

Maybe an another possible approach could be to force by the specific documents to skip the original "Print Form" when click on the "Print" button in the "File" menu but I guess it probably more complicated if at all possible.

Can someone help me with a real solution about it?

Thanks

P.S. Sorry for my English.

Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
954 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.