I have a WPF WebBrowser Control in a WPF app, on a web page (visited in the WPF browser) I have a VBScript Print() sub to print a receipt without promoting the user.
<script language='VBScript'>
Sub Print()
OLECMDID_PRINT = 6
OLECMDEXECOPT_DONTPROMPTUSER = 2
OLECMDEXECOPT_PROMPTUSER = 1
call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
End Sub
document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>"
</script>
Since adding this VBScript Print() I now am prompted with the following in my WPF Browser:
internet explorer blocked an activex control so this page might not
display correctly
How can I either prevent the message and just run the script, or at very worst show a prompt?
The solution for us in the end was to use Silverlight 5 to print the page without prompting the user as Silverlight 5 provides a way to print without prompting the user using
ElevatedPermissions.