Opening docs with word in IE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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,
 
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
*******************************************************
 
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."
 
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.
 
Back
Top