tag:blogger.com,1999:blog-7176045.post-1115203335855339952005-05-04T14:26:00.000+04:002005-05-04T14:42:15.996+04:002005-05-04T14:42:15.996+04:00ActiveX control to host Office documentsQuite interesting control <strong>Dsoframer.ocx</strong> can be found in <a href="http://support.microsoft.com/kb/311765">this</a> KB article - ActiveX control that acts as an ActiveX document container for hosting Office documents (including Microsoft Word, Microsoft Excel, Microsoft PowerPoint, Microsoft Project, and Microsoft Visio documents).<br />Some interesting properties and methods:<br /><br /><span style="font-family:courier new;font-size:85%;">// Generated .IDL file (by the OLE/COM Object Viewer) // // typelib filename:<br />DSOFRAMER.OCX<br /><br />typedef enum {<br />dsoDialogNew = 0,<br />dsoDialogOpen = 1,<br />dsoDialogSave = 2,<br />dsoDialogSaveCopy = 3,<br />dsoDialogPrint = 4,<br />dsoDialogPageSetup = 5,<br />dsoDialogProperties = 6<br />} <b>dsoShowDialogType</b>;<br /><br /><br /><br />typedef enum {<br />dsoFileNew = 0,<br />dsoFileOpen = 1,<br />dsoFileClose = 2,<br />dsoFileSave = 3,<br />dsoFileSaveAs = 4,<br />dsoFilePrint = 5,<br />dsoFilePageSetup = 6,<br />dsoFileProperties = 7,<br />dsoFilePrintPreview = 8<br />} <b>dsoFileCommandType</b>;<br /><br /><br />[id(0x00010013), propput, helpstring("Returns/sets whether a menu bar should be<br />displayed.")]<br />HRESULT <b>Menubar</b>([in] VARIANT_BOOL pbool);<br /><br />[id(0x00010014), propput, helpstring("Returns/sets host application name (used<br />in embedding).")]<br />HRESULT <b>HostName</b>([in] BSTR pbstr);<br /><br />[id(0x00010016), helpstring("Prints current document to specific printer with<br />settings.")]<br />HRESULT <b>PrintOut</b>(<br />[in, optional] VARIANT PromptUser,<br />[in, optional] VARIANT PrinterName,<br />[in, optional] VARIANT Copies,<br />[in, optional] VARIANT FromPage,<br />[in, optional] VARIANT ToPage,<br />[in, optional] VARIANT OutputFile);<br /><br />[id(0x00000001), helpstring("Called when File menu item is selected by user (may<br />be canceled).")]<br />HRESULT <b>OnFileCommand</b>(<br />[in] dsoFileCommandType Item,<br />[in, out] VARIANT_BOOL* Cancel);<br /><br />[id(0x00000002), helpstring("Called when document is opened or new document<br />added.")]<br />HRESULT <b>OnDocumentOpened</b>(<br />[in] BSTR File,<br />[in] IDispatch* Document);<br /><br />[id(0x00000003), helpstring("Called when document is closed.")]<br />HRESULT <b>OnDocumentClosed</b>();<br /></span>Alex Dybenkohttp://www.blogger.com/profile/16954512620659022712noreply@blogger.com2