rengeek33 Posted April 14, 2004 Posted April 14, 2004 I need to be able to open, edit, add files to, and save a word document from within my WinForm program. I've read a number of threads about the Word object, but none of them talk about displaying the document in some control. In VB6 I would use the object container and open the word object inside of it. It would display the object. I can't see what object to use here. Any answers? Thanks Quote
*Gurus* divil Posted April 16, 2004 *Gurus* Posted April 16, 2004 There is currently no windows forms control to display ActiveX (ole) documents. In the next release of .NET and Visual Studio, this will be addressed with the ActiveDocumentContainer control. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
grimmettm Posted April 20, 2004 Posted April 20, 2004 Using Web Browser Object To Display OFFICE DOCUMENTS To display an office file in Windows, you can do this using the web browser object in the toolbox. See sample code below I created to view a Bill of Lading document created in the shipping department. This application is used to view and/or manipulate these files. Once file is loaded-(NavigateComplete) Then I set the current document and hide the toolbars, which is optional. You can control which toolbars are available to the users. Private Sub frmViewBOL_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim strMyBOL As String = strBOL_FileDIR & strBillOfLading & ".doc" If File.Exists(strMyBOL) Then oDoc = Nothing webViewBOL.Navigate(strMyBOL) Me.Text = "View Bill of Lading " & strBillOfLading Else MsgBox("Bill of Lading Not On File", MsgBoxStyle.Critical, msgTimken) Me.Close() End If End Sub Private Sub webViewBOL_NavigateComplete2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event) Handles webViewBOL.NavigateComplete2 oDoc = e.pDisp.document webViewBOL.ExecWB(SHDocVw.OLECMDID.OLECMDID_HIDETOOLBARS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT) End Sub Quote
anjanesh Posted July 15, 2006 Posted July 15, 2006 There is currently no windows forms control to display ActiveX (ole) documents. In the next release of .NET and Visual Studio, this will be addressed with the ActiveDocumentContainer control. Is .NET 2005 the next release you were talking abt ? Since the post was made in 2004, I was wondering if the OP's issue can be solved in VB .NET 2005 Exp Edition. Quote
Recommended Posts