BradDuns
asked on
Debug Error/ print current page/ Background printing
I am trying to make a button to print the current page, though many of the pages are outside of the printable page area so i want to get rid of the dialog "outside of the...do you wish to continue..." box. I tried to piece together some code but i get a 424 object required error on the last line. Can anyone help? Here is what i have.
Sub PrintCurr()
Application.DisplayAlerts = wdAlertsNone
ActiveDocument.PrintOut Background:=False, Range:=wdPrintCurrentPage
Application.DisplayAlerts = wdAlertsAll
End Sub
Thanks
Brad
Sub PrintCurr()
Application.DisplayAlerts = wdAlertsNone
ActiveDocument.PrintOut Background:=False, Range:=wdPrintCurrentPage
Application.DisplayAlerts
End Sub
Thanks
Brad
ASKER
it prints if i get rid of the display alerts but i still see the dialog box, and it's the same when i use defaults on the print out line.
I'm at a loss to help as I've copy/pasted your code onto my PC and it works fine.
Where is your button located? Perhaps Word cannot determine what the ActiveDocument is?
Where is your button located? Perhaps Word cannot determine what the ActiveDocument is?
ASKER
thanks for the help
the button is in one of my custom toolbars. the macro is located in a template which my document is built from. i tried to move the macro into the actual doc instead of the template but the same thing happened. when i run the debug the last line "Application.DisplayAlerts = wdAlertsAll" is highlighted. I am also running word 2004 on Mac i don't know if that matters.
the button is in one of my custom toolbars. the macro is located in a template which my document is built from. i tried to move the macro into the actual doc instead of the template but the same thing happened. when i run the debug the last line "Application.DisplayAlerts
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The code withou the application worked great.
thank you
thank you
Otherwise, I can't see a lot wrong with the above.