Disable Print Preview menu item
Apr/070
We received the requirement to disable the Print Preview functionality in the entire application.
After searching a while, my colleague asked for help because he didn’t found anything on Supportweb about this and all his tries to disable it failed. Inactivating the Menu Item ‘File – Print Preview’ didn’t result in greying out the option from the menu. Even after deleting the cache of Internet Explorer, we could still do a Print Preview.
Searching Supportweb with the query “disable print preview” didn’t help us at all. Not a single SR was created with this problem. In the end I searched for “print preview” and finally I stumbled upon a piece of code that works. The code is actually very simple and is used on the PrintListService Business Service.
If you want to disable the Print Preview, use the following code in Server Script (eScript)
function Service_PreCanInvokeMethod (MethodName, &CanInvoke)
{
if(MethodName == “QuickPrintPreviewCustomAppletMenu”){
return(CancelOperation);
}
return (ContinueOperation);
}
This will disable the functionality in the entire application. It does not remove the menu item from the menu but just disables it (it becomes greyed out).
No comments yet.
Leave a comment
No trackbacks yet.