AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Wednesday, May 04, 2005

ActiveX control to host Office documents

Quite interesting control Dsoframer.ocx can be found in this 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).
Some interesting properties and methods:

// Generated .IDL file (by the OLE/COM Object Viewer) // // typelib filename:
DSOFRAMER.OCX

typedef enum {
dsoDialogNew = 0,
dsoDialogOpen = 1,
dsoDialogSave = 2,
dsoDialogSaveCopy = 3,
dsoDialogPrint = 4,
dsoDialogPageSetup = 5,
dsoDialogProperties = 6
} dsoShowDialogType;



typedef enum {
dsoFileNew = 0,
dsoFileOpen = 1,
dsoFileClose = 2,
dsoFileSave = 3,
dsoFileSaveAs = 4,
dsoFilePrint = 5,
dsoFilePageSetup = 6,
dsoFileProperties = 7,
dsoFilePrintPreview = 8
} dsoFileCommandType;


[id(0x00010013), propput, helpstring("Returns/sets whether a menu bar should be
displayed.")]
HRESULT Menubar([in] VARIANT_BOOL pbool);

[id(0x00010014), propput, helpstring("Returns/sets host application name (used
in embedding).")]
HRESULT HostName([in] BSTR pbstr);

[id(0x00010016), helpstring("Prints current document to specific printer with
settings.")]
HRESULT PrintOut(
[in, optional] VARIANT PromptUser,
[in, optional] VARIANT PrinterName,
[in, optional] VARIANT Copies,
[in, optional] VARIANT FromPage,
[in, optional] VARIANT ToPage,
[in, optional] VARIANT OutputFile);

[id(0x00000001), helpstring("Called when File menu item is selected by user (may
be canceled).")]
HRESULT OnFileCommand(
[in] dsoFileCommandType Item,
[in, out] VARIANT_BOOL* Cancel);

[id(0x00000002), helpstring("Called when document is opened or new document
added.")]
HRESULT OnDocumentOpened(
[in] BSTR File,
[in] IDispatch* Document);

[id(0x00000003), helpstring("Called when document is closed.")]
HRESULT OnDocumentClosed();

2 Comments:

Anonymous Anonymous said...

Hello,
I'm looking for some pointers on this control. I've read the KB on the DSOFramer control, but when I implement it on my webform.aspx, it does not provide open methods as outliked in the Microsoft KB article. Such as stated:
DSOFramer1.Open("c:\myfile.doc")

I use Imports DSOFramer after including a reference to the OCX control. Then I try:
DSOFramer.Open("c:\myfile.doc") and DSOFramer is not declared? Any help is very apprciated.

Thanks in advance,
Joe

2:02 AM  
Blogger Alex Dybenko said...

Hi Joe,
i am not so good in using OCX on Web pages, so can not help you here

8:01 AM  

Post a Comment

Links to this post:

Create a Link

<< Home