This is the discussion forum for the HtmlEditor. See also the
HtmlEditor home page, where you can download the control, and the
Documentation Wiki, a collaborative project for documenting the control.
Print preview window doesn't appear after the first call to Exec()
Posted by: Blade
Date: Sunday, 19-Mar-2006, 22:52:52
I implemented a simple functionality - issued a print preview command (IDL_PRINTPREVIEW) using IOleCommandTarget::Exec(). It works fine the first time - the print preview window opens. But after this point, it doesn't appear again - the successive calls to Exec don't throw any exeptions, nothing, they pass as regular working code. And it stays like this until you close the browser (it doesn't help to navigate to another page). The print preview command on the File menu stops working also.
Here is the two-liner:
this.ComandGroup = new Guid("DE4BA900-59CA-11CF-9592-444553540000");
IOleCommandTarget cmdTarget = (IOleCommandTarget)this._document;
object templateName = null;
object n = null;
cmdTarget.Exec(ref this.ComandGroup, Additional.IDM_PRINTPREVIEW, (int)OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER, ref templateName, ref n);