MsWord With Asp.Net on theserver

  • Thread starter Thread starter Y.A.
  • Start date Start date
Y

Y.A.

I want to start msWord on the server with an a givene file
(.doc), customize the file (update it) then display it on
the client machine -- all this on intranet using asp.net.
I know it's doable with some javascript using ActiveX --
is anyone aware for another way to do it
 
MSWord is not really a server side tool, and you can easily hang your server
by leaving too many instances open. That said, someone has kindly provided
an excellent tuorial on doing it....

http://www.codeproject.com/aspnet/wordapplication.asp

A better approach might be to create RTF files or HTML files, which are just
text really, and pass them with a .DOC extension. Word is clever enough to
usually open them in the correct way and convert them for you at the client
side - of course you will need to test this.

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
 
-----Original Message-----
How do you do it with javascript?
<script language="javascript">
function f(){
var word = new ActiveXObject
("Word.Application");
word.Visible = true;
word.Documents.Add("Normal.dot", false, 0);
var b = word.ActiveDocument.bookmarks
('NAME');
b.range.Text = 'O\'Neil';
}
</script>

<HTML>
<HEAD><TITLE>Testing Word from HTML</Title></HEAD>
<BODY OnLoad='f()'>
You may as well function using Ranges.
 
Thanks.
-----Original Message-----

<script language="javascript">
function f(){
var word = new ActiveXObject
("Word.Application");
word.Visible = true;
word.Documents.Add("Normal.dot", false, 0);
var b = word.ActiveDocument.bookmarks
('NAME');
b.range.Text = 'O\'Neil';
}
</script>

<HTML>
<HEAD><TITLE>Testing Word from HTML</Title></HEAD>
<BODY OnLoad='f()'>

You may as well function using Ranges.
.
 
A better way to create WordML based documents serverside. You can create the
Word document using an XML based formatting, which is easy to manipulate
using the XML interfaces.

A small introduction is posted at:
http://msdn.microsoft.com/msdnmag/issues/03/11/XMLFiles/default.aspx

Naturally you have to keep in focus which Word version you are supporting.
The 2k3 versions are obvious the more enhanced versions, but previous
versions do have a xml document definition available.

For this older version (Office2k) have a look at this download:
http://forums.devshed.com/attachment.php?s=66416f7078be04d2327913424257978a&postid=305567

The message is: Do not start Word at the server!

-= Maarten van Stam =-
(e-mail address removed)
 
Back
Top