Sdílet prostřednictvím


Hosting Office in .NET applications

If you are building a .NET application and you are struggling to find a way to host Word documents, Excel spreadsheets, Visio drawings, Project files, or PowerPoint presentations, you might consider using the Visual C++ ActiveX Control for hosting Office documents. I learned about this download resource and I was shocked to see how you can add it to your solution and start working with Office applications in less than a minute. You can open Office applications, format content, update documents, save changes, print, and more inside your application. The Office Framer Control is an Active X control written in C++. The download includes source code to extend the functionality and sample code to use it inside Visual Basic 6 and HTML pages. You can also enable and disable specific functionality by using a full set of properties, methods, and events exposed for customization.

You can also host the control inside managed applications following these simple steps:

  1. Download and install the Office Framer Control 1.2 Sample.
  2. Start Visual Studio .NET. 
  3. Open your WinForms or WebForms application.
  4. Add the DSO Framer Control to the Toolbox: 
    • On the Tools menu, click Customize Toolbox (in Visual Studio .NET 2002), or click Add/Remove Toolbox Items (in Visual Studio .NET 2003), and then click the COM Components tab. 
    • On the COM Components tab, select DSO Framer Control Object. 
    • Click OK to close the Customize Toolbox dialog box.
  5. Select the DSO Framer Control icon that appears in the ToolBox and drag-and-drop the control over the Form or Web Form.
  6. Adjust the control’s docking/size as needed.
  7. Build and run the application.
  8. Create a new document to test the control.

I have to warn you that the control is not supported, the control and the source code is provided AS-IS for customization. However, you still can extend the functionality and it does the job, so have a peek and enjoy!

Comments

  • Anonymous
    October 18, 2005
    Hello Erika! I am writing to you from Portugal. I'm a Microsoft Application Developer and I own a small ISV company and I develop many applications that integrate with Office (especialy in VB6 and VBA). I have been a developer for .NET since the first versions ou VS.NET and now I am developing integration with Office using .NET instead of VB6. I have to say that I found your blog very usefull and this tool here (DSO Framer Control) is realy cool. I'm going to explore it a little bit more. Thanks!

    Rui Alves
    ruialves@edireizinho.pt

  • Anonymous
    October 18, 2005
    Nice tool. I am going to check it out and explore it a little bit more.

    ruialves@edireizinho.pt
    PORTUGAL

  • Anonymous
    March 23, 2006
    Hi
    Its really pretty good control. I want to use it in my application but when i included the project in my application its giving an error

  • Anonymous
    April 06, 2006
    Cyrillic symbols in menu shows incorrectly

  • Anonymous
    April 07, 2006
    I am porting an MFC application to .NET using C#.  The app has the feature of establishing OLE Link with Excel.  For example, user can copy a cell from Excel 2003 and do "Paste Link" to the app, and these 2 become linked together through OLE Link.

    I could not find anything on the internet do enable me to do that in C# and .NET.  Will this control help on this issue?

    Also I just heard about VS Tools for Office but have not tried it.  Does VSTO offer any help in this issue?

    Thank you in advance for any input.

    TJ

  • Anonymous
    April 11, 2006
    Hi,
    The control seems to work fine but i'm having trouble deploying it using one touch in vs2005.
    when i try to run the application on another machine i get the following error,

    System.InvalidCastException: No such interface supported at DSOFramer._FramerControl.get_ActiveDocument()

  • Anonymous
    May 18, 2006
    dear erika, hi great control, ot sure if i should post this here but having trouble opening a document on a remote server using URL,in write mode (oframe.open). document opens only if i say read only - i have check folder permissions etc. but no luck...the error msg says unspecified error on the open.. can you help?

  • Anonymous
    May 30, 2006
    I want to access the DSO Framer Control Object programetically ?

    if open/save form url should one open form
    specified folder

    and i want to disaply some menu option

  • Anonymous
    August 01, 2006
    Is there similar control in the native .NET?

    Love.
    http://FrogFind.com

  • Anonymous
    August 08, 2006
    can someone help me open a excel file through code using dsoFramer.
    Opening through file menu is perfect.
    but opening through code is giving me a lot of trouble.
    I am using Visual C++ 6. Enterprise Edition

    Hope to listen from someone :(

  • Anonymous
    August 22, 2006
    Is there a place where all the events and properties of DSOFramer are listed? Its turning out to be a major time taker while searching for them.
    Thanks.

  • Anonymous
    October 22, 2006
    readonly do not work ,please give me some help ,thank you! tjjhua@hotmail.com

  • Anonymous
    November 09, 2006
    Pls. can u tell me which versions of Internet Explorer support DSO Framer controls. And tell me which other browsers support it with which plug-ins. Pls. tell me am facing problem in opening DSO framer in my Internet Explorer. Pls. tell me clearly because i have clear this problem to my client also. My email : aleem_abdul@akebonosoft.com Aleem.

  • Anonymous
    November 10, 2006
    Pls. can u tell me which versions of Internet Explorer support DSO Framer controls. And tell me which other browsers support it with what plug-ins. Pls. tell me am facing problem in opening DSO framer in my browser. Pls. tell me clearly because i have to clear this problem to my client also. My email : aleem_abdul@akebonosoft.com Aleem.

  • Anonymous
    March 12, 2007
    The comment has been removed

  • Anonymous
    March 25, 2007
    You can install it in the 2005 toolbox. Pretty tricky though. Furthermore... is you do a lot of calls I get timing issues with the Excel COM. I haven't found a way to time the threads yet.

  • Anonymous
    March 26, 2007
    Hello I can't set summary property (Keywords). Help me please

  • Anonymous
    May 09, 2007
    Hi ! im using the DSO but i want to set the zoom of the document by code .. and some others propertys, can anybodi help me ? Tnx ! rcasstelo@hotmail.com

  • Anonymous
    May 11, 2007
    Hi! ALL       The site is grt. Can anyone direct me how  to host complete visio in the .net managed application using dsoframer ? I have used visio drawing control. I want visio in my application like the one shown in the pic in this page

  • Anonymous
    May 11, 2007
    my mail id kalam.pattan@gmail.com

  • Anonymous
    August 02, 2007
    The comment has been removed

  • Anonymous
    August 14, 2007
    Will you marry me.  Thanks...just what I needed!!!

  • Anonymous
    August 14, 2007
    Every time I call the print preview, the ms office crashed when exit the print preview. I am using the Office 2003. It's very strange thing. I have update all the office package. But it look like no help. Any suggests are welcome.

  • Anonymous
    October 25, 2007
    I want to add commandbars to DSoframer control(i mean after opening a word document only)and add items dynamically to the commandbar control dropdownlist. I am customizing the source code for my purpose. Please advice me  is this possible?

  • Anonymous
    October 31, 2007
    I can't add dso framer to the vs2005 toolbox could you help me please???

  • Anonymous
    December 18, 2007
    Hi, many people are asking about adding DSO framer into VS2005 toolbox. Does anyone have a reply for this, as I have not managed either.  When adding the DSO framer to the toolbox (VS2005) the control appears disabled, and I am not able to use it. Any ideas?  The same thing happens when adding the Visio Drawing Control to the toolbox in VS2005

  • Anonymous
    January 28, 2008
    The comment has been removed

  • Anonymous
    February 12, 2008
    I developed an application with VB 2005. I'm using dsoframer control in the application to host MS Word document. I have no problem to load the word doc inside the dsoframer. But the problem is every time i click on the Print Preview button to preview the document and then close the print preview screen, the loaded document become a blank document inside dsoframer. In other word, the content on the document is gone! Then i tried to click on the Print preview button again, i found out that the content is still there under the preview mode. But i wonder why when i clicked on the close print preview, the content of the document is gone?? Can anybody tells me why and how to fix this? Thanks in advanced...

  • Anonymous
    February 14, 2008
    I have tried to download the control from the page listed above (http://support.microsoft.com/default.aspx?scid=kb;en-us;311765) but I get an error when i try to run the exe.  The error message states the file is not a valid win32 application.  Is there another download place?  Is anyone else having this problem?? Thank you, zh

  • Anonymous
    February 14, 2008
    The comment has been removed

  • Anonymous
    May 04, 2008
    Got this control to work relatively well using VB.NET after starting to play with the FramehookPolicy and ActivationPolicy properties. Stil another problem remains... when loading MsProject and opening the "Task Information" dialog, it appears it does not recieve some of the messages (e.g. cannot change fields in it). Anybody out there with some suggestions? Shall be much appreciated. Regards.

  • Anonymous
    May 24, 2008
    hi,i have tried the method ,and it's cool . but can you tell me how to get a reference of the  document/worksheet  that the cotrol opened? i want to change something through code,so it's important to me.

  • Anonymous
    June 15, 2008
    Good afternoon. I was trying to open a word document programaticaly on my page load event of the webform. Like this: objWordDoc = New DSOFramer.FramerControl objWordDoc.EventsEnabled = True objWordDoc.ModalState = False objWordDoc.Open("WORD_URL_PATH", True) But it despalys an error. Can anyone tell me if I'm doing anything wrong? Best regards, Ana Silva.

  • Anonymous
    June 19, 2008
    Has anyone tried using this control in an ASP .Net application? The DSO Framer Control in the toolbox appears greyed out for ASP .Net apps, but is available for Windows Apps.

  • Anonymous
    July 08, 2008
    Hi, I'm also involved in asp.net version. Could anyone share some source code?

  • Anonymous
    August 23, 2008
    Hi All, Can any one help me or provide me a sample code. How to save a word document on web server through DSOFramer.ocx I will appreciate if the code in c# Very Best Regards,

  • Anonymous
    May 24, 2009
    Hello, Its really nice tool,but i would like to open XML file but it is giving me error. what i need to do to open XML files and office 2007 files.

  • Anonymous
    July 13, 2009
    Hi, I'm not very much familiar with vc++. I worked with this control. I want to extend the functionality of this control. I want to restrict the user to copy and paste the document when it is necessary. How can i do this? Please help. Regards, Niluka

  • Anonymous
    November 12, 2009
    How can i download the control? the url do not work fine.

  • Anonymous
    June 14, 2010
    Thank you. I have one problem. I used Dsoframer.ocx . But i have error or warning "Unable to display inactive document click here to reactive object" . Now to solve. Thanks for reply.

  • Anonymous
    December 04, 2013
    I have found this to be an amazing tool. It is working quite well for what I need. However, when I close an xlsm file from the code-behind, I get an error when trying to reopen the document. Any feedback would be highly appreciated. Email: paul.moura@sgs.com