471,344 Members | 1,248 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,344 software developers and data experts.

Opening docs with word in IE

I am hoping someone can tell me how, or point me in the right direction for
the following problem. I need to have word open a specified file, .mht, as a
plug-in inside of IE so that I can edit this file within the word plugin
within IE. I am not even sure how I can get this to work with a .doc file. I
appreciate any help you can give......Thanks, Jason
Jul 22 '05 #1
6 3699
You have to associate the MHT file type with Word (e.g. Windows
Explorer->Tools->Folder Options->File Types)

Additionally you have to tell word to stay within IEXplorer and not to
open a new window (unfortunately I don't know where to do that)

This workesd for me fine with a custom application and IExplorer.

Hope this helps,
Pascal

Jul 22 '05 #2
Can you help me with the code to create a word application object and then
how to utilize that object to open a regular .doc file?.....Thanks,
"pa***********@web.de" wrote:
You have to associate the MHT file type with Word (e.g. Windows
Explorer->Tools->Folder Options->File Types)

Additionally you have to tell word to stay within IEXplorer and not to
open a new window (unfortunately I don't know where to do that)

This workesd for me fine with a custom application and IExplorer.

Hope this helps,
Pascal

Jul 22 '05 #3
here are some links to get you started. You may also want to google for
"office or word automation "

http://msdn.microsoft.com/library/de..._ancoffsol.asp
http://support.microsoft.com/?kbid=316384
http://support.microsoft.com/kb/302902/

Jul 22 '05 #4
I checked out these sites and came up with the following code and I am
getting a "Cannot create ActiveX Component" error message when I select the
button; and it's failing on "oword = CreateObject("Word.Application")". Also,
I did add the reference to the word object as the examples showed. Thanks
agian for your help.
************************************************** *****
Imports word = Microsoft.Office.Interop.Word

Public Class proddocs
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim oword As word.ApplicationClass
oword = CreateObject("Word.Application")
oword.Visible = True
oword.Documents.Open("c:\jason.doc")
oword.Activate()
End Sub
End Class
************************************************** *****

"pa***********@web.de" wrote:
here are some links to get you started. You may also want to google for
"office or word automation "

http://msdn.microsoft.com/library/de..._ancoffsol.asp
http://support.microsoft.com/?kbid=316384
http://support.microsoft.com/kb/302902/

Jul 22 '05 #5
I have no idea about ASP.NET but this may anwser your question:

http://support.microsoft.com/?id=257757

"Microsoft strongly recommends that developers find alternatives to
Automation of Office if they need to develop server-side solutions.
Because of the limitations to Office's design, changes to Office
configuration are not enough to resolve all issues. Microsoft
recommends a number of alternatives that do not require Office to be
installed server-side, and that can perform most common tasks more
efficiently and quickly than Automation. Before involving Office as a
server-side component in your project, consider alternatives."
Jason Steeves wrote:
I checked out these sites and came up with the following code and I am
getting a "Cannot create ActiveX Component" error message when I select the
button; and it's failing on "oword = CreateObject("Word.Application")". Also,
I did add the reference to the word object as the examples showed. Thanks
agian for your help.
************************************************** *****
Imports word = Microsoft.Office.Interop.Word

Public Class proddocs
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim oword As word.ApplicationClass
oword = CreateObject("Word.Application")
oword.Visible = True
oword.Documents.Open("c:\jason.doc")
oword.Activate()
End Sub
End Class
************************************************** *****

"pa***********@web.de" wrote:
here are some links to get you started. You may also want to google for
"office or word automation "

http://msdn.microsoft.com/library/de..._ancoffsol.asp
http://support.microsoft.com/?kbid=316384
http://support.microsoft.com/kb/302902/


Jul 22 '05 #6
I do not know what "*.mht" and the plug-in you are talking are, but your
code of "Button1_Click" gets run on the web server, and you are trying to
start a Word app on the server side (do you installed Word on the web
server?). Is it what you want? I do not think so. Also, it is strongly not
recommended to run a desktop app, like Word, on web server, although it can
be run that way with carefully designed system. What you want is to
streamming the *.mht file data to user's browser and the plug-in (for IE,
right) start Word via that plug-in, assume that plug-in is installed on
client end or being installed when your web page is loaded the first time on
client browser side.

"Jason Steeves" <Ja**********@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
I checked out these sites and came up with the following code and I am
getting a "Cannot create ActiveX Component" error message when I select the button; and it's failing on "oword = CreateObject("Word.Application")". Also, I did add the reference to the word object as the examples showed. Thanks
agian for your help.
************************************************** *****
Imports word = Microsoft.Office.Interop.Word

Public Class proddocs
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim oword As word.ApplicationClass
oword = CreateObject("Word.Application")
oword.Visible = True
oword.Documents.Open("c:\jason.doc")
oword.Activate()
End Sub
End Class
************************************************** *****

"pa***********@web.de" wrote:
here are some links to get you started. You may also want to google for
"office or word automation "

http://msdn.microsoft.com/library/de..._ancoffsol.asp http://support.microsoft.com/?kbid=316384
http://support.microsoft.com/kb/302902/

Jul 22 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by rockocubs | last post: by
reply views Thread by Maheshwari | last post: by
reply views Thread by Stephen Witter | last post: by
4 posts views Thread by Thomas Scheiderich | last post: by
6 posts views Thread by Jason Steeves | last post: by
reply views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.