472,805 Members | 997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 3780
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sivaraman.S | last post by:
Issue: When I am opening a word document or a template from an ASP.NET Web page (language used VB.NET Visual Studio Version 2003) using Word.ApplicationClass object (Reference Word 11.0 object...
7
by: rockocubs | last post by:
I am working on a table of contents page in html for an intranet, i want to click on links to documents and have them open up in word and not word in the browser, is there a way to do this.
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
0
by: Maheshwari | last post by:
Hi Can you please help with some info on how to open existing word documents / merge two word documents from a C# program ? My user will select 2 or many word docs and i have to create a c# exe...
0
by: Stephen Witter | last post by:
I have been banging my head trying to find a way either in classic asp or asp dot net to get a word document to open in word, and not use the browser. I have tried (in classic asp): ...
4
by: Thomas Scheiderich | last post by:
I can't seem to open a word document from any of my browsers except the one on my web server. Here is the .aspx file: ***************************************************************** <%@...
6
by: Jason Steeves | last post by:
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...
2
by: bbasberg | last post by:
Hello, I have been asked to move a paragraph to a new location in over 360 Word documents. I was shocked to find out that changing an attached template will only affect documents produced from...
0
by: ahammad | last post by:
I already know how to open an existing Word document using automation. What I want to do is to open a blank Word document that I can then write to. What changes should be made to this code? ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.