473,739 Members | 6,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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......Thank s, Jason
Jul 22 '05 #1
6 3857
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?.....Thank s,
"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("W ord.Application ")". Also,
I did add the reference to the word object as the examples showed. Thanks
agian for your help.
*************** *************** *************** **********
Imports word = Microsoft.Offic e.Interop.Word

Public Class proddocs
Inherits System.Web.UI.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub
Protected WithEvents Button1 As System.Web.UI.W ebControls.Butt on

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

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

#End Region

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

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim oword As word.Applicatio nClass
oword = CreateObject("W ord.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("W ord.Application ")". Also,
I did add the reference to the word object as the examples showed. Thanks
agian for your help.
*************** *************** *************** **********
Imports word = Microsoft.Offic e.Interop.Word

Public Class proddocs
Inherits System.Web.UI.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub
Protected WithEvents Button1 As System.Web.UI.W ebControls.Butt on

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

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

#End Region

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

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim oword As word.Applicatio nClass
oword = CreateObject("W ord.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_Cl ick" 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**********@d iscussions.micr osoft.com> wrote in message
news:77******** *************** ***********@mic rosoft.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("W ord.Application ")". Also, I did add the reference to the word object as the examples showed. Thanks
agian for your help.
*************** *************** *************** **********
Imports word = Microsoft.Offic e.Interop.Word

Public Class proddocs
Inherits System.Web.UI.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub
Protected WithEvents Button1 As System.Web.UI.W ebControls.Butt on

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

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

#End Region

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

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim oword As word.Applicatio nClass
oword = CreateObject("W ord.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
4011
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 Library), I am getting the following error: could not open macro storage (System.Runtime.comExeception) I am not getting any errors while opening the same word document or a template from a windows application. (Language Used VB.NET)
7
1896
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
5586
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 document in Word; 2. opens the document and runs the merge process for the new data. I have managed to write the code to perform step 1 ok, but I'm having trouble with step 2. It opens the word document fine but does not perform the mail merge of...
0
1364
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 which add all word docs to one word document. Thanks in Advance Maheshwari
0
944
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): Response.ContentType = "application/ms-word" Response.AddHeader "Content-Disposition", "attachment; filename='\\Server\SomeDirectory\SomeDoc.doc'" too no avail. The documents are on a network drive. Do I have to create a virtual drive in IIS and refer...
4
1745
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: ***************************************************************** <%@ Import Namespace="System.Data.SqlClient" %> <%@ import Namespace="System.IO" %> <Script Runat="Server">
6
364
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 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
2
1396
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 the template in the future. So it doesn't work like a style sheet, for example. But, I digress, my question is: is there a means in Visual Basic, or using a macro, or anything else that can help me automate this? I have no doubt the boss will ask...
0
1124
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? _Document myDoc; COleVariant covTrue((short)TRUE); COleVariant covFalse((short)FALSE); COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR); Documents docs = wordAppLib.GetDocuments(); CString ReportFileName(_T("filepath goes here"));
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9479
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9266
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8215
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6754
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6054
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3280
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.