IWebBrowser and Printing

Assuming I have managed to embed a WebBrowser control from the ActiveX SDK client window that I have created, how can I instruct it to print its content?
xen15Asked:
Who is Participating?
 
lohcheekConnect With a Mentor Commented:
Hello,

//the code fragment

LPDISPATCH disp;
IOleCommandTarget* target;

WebBrowser_Object->QueryInterface (IID_IOleCommandTarget,(void **)&target);
target->Exec(NULL,OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER,NULL,NULL);

I have assumed that you have already obtained the WebBrowser control pointer (WebBrowser_Object). The details of this can be found in Microsoft's web site on the IE WebBrowser control.
0
 
lohcheekCommented:
With respect to the above answer, WebBrowser_Object should be the IDispatch instead. Sorry for the mistake.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.