MsWord With Asp.Net on theserver

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
 
J

John Timney \(Microsoft MVP\)

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>
 
G

Guest

-----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.
 
Y

Yohancef Chin

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.
.
 
J

Joe Dokus

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top