473,387 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Client-side Word Automation from asp.net

In asp we can run VBSCRIPT client-side which allows
for 'easy' :?) ms office COM object instantiation. How do
I access a Word object in ASP.NET on the client side?

I would like to do spell checking from a web-based wysiwyg
editor and I am limited to using ms word from the client,
server-side word automation is out of the question for
several important reasons
(http://support.microsoft.com/default.aspx?
scid=http://support.microsoft.com:80/support/kb/articles/Q2
57/7/57.asp&NoWebContent=1) . Although this
(http://www.codeproject.com/aspnet/wordapplication.asp)
article helps a little bit.

Any help will be appreciated!

Thanks,

yv
Nov 18 '05 #1
6 5178
Take a look at the client side example in this article (near the end):
http://www.aspnetpro.com/NewsletterA...200309so_l.asp

The example uses Excel but it should still be helpful to you.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Yuri Vanzine" <yp*@tft.com> wrote in message
news:1a****************************@phx.gbl...
In asp we can run VBSCRIPT client-side which allows
for 'easy' :?) ms office COM object instantiation. How do
I access a Word object in ASP.NET on the client side?

I would like to do spell checking from a web-based wysiwyg
editor and I am limited to using ms word from the client,
server-side word automation is out of the question for
several important reasons
(http://support.microsoft.com/default.aspx?
scid=http://support.microsoft.com:80/support/kb/articles/Q2
57/7/57.asp&NoWebContent=1) . Although this
(http://www.codeproject.com/aspnet/wordapplication.asp)
article helps a little bit.

Any help will be appreciated!

Thanks,

yv

Nov 18 '05 #2
Thanks Steve! This should get it started:

<script language="javascript">
var word = new ActiveXObject("Word.Application");
word.Visible = true;
word.Documents.Add("Normal", false, 0);
var range = word.ActiveDocument.Range(0, 0);
range.InsertBefore("hey testing this");
range.Font.Name = "Arial";
range.Font.Size = 24;
range.InsertParagraphAfter();
//var pause = 0;
//var nopause = 1;
//var wdDialogFileOpen = 80;
//var wdDialogToolsOptionsSpellingAndGrammar = 203;
//var dialog = word.Dialogs
(wdDialogToolsOptionsSpellingAndGrammar);
//var button = dialog.Show(1);

//word.ActiveDocument.CheckGrammar();
//word.ActiveDocument.CheckSpelling();
//word.ActiveDocument.SaveAs("Mydoc.txt", 4);
word.Quit();
</script>
-----Original Message-----
Take a look at the client side example in this article (near the end):http://www.aspnetpro.com/NewsletterA...003/09/asp2003 09so_l/asp200309so_l.asp
The example uses Excel but it should still be helpful to you.
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able- consulting.com

"Yuri Vanzine" <yp*@tft.com> wrote in message
news:1a****************************@phx.gbl...
In asp we can run VBSCRIPT client-side which allows
for 'easy' :?) ms office COM object instantiation. How do I access a Word object in ASP.NET on the client side?

I would like to do spell checking from a web-based wysiwyg editor and I am limited to using ms word from the client, server-side word automation is out of the question for
several important reasons
(http://support.microsoft.com/default.aspx?
scid=http://support.microsoft.com:80/support/kb/articles/Q2 57/7/57.asp&NoWebContent=1) . Although this
(http://www.codeproject.com/aspnet/wordapplication.asp)
article helps a little bit.

Any help will be appreciated!

Thanks,

yv

.

Nov 18 '05 #3
Thanks! As a follow-up, this works when you enable unsafe
activeX in IE:

<script language="javascript">
var word = new ActiveXObject("Word.Application");
word.Visible = true;
word.Documents.Add("Normal", false, 0);
var range = word.ActiveDocument.Range(0, 0);
range.InsertBefore("hey testing this");
range.Font.Name = "Arial";
range.Font.Size = 24;
range.InsertParagraphAfter();
word.Quit();
</script>
-----Original Message-----
Take a look at the client side example in this article (near the end):http://www.aspnetpro.com/NewsletterA...003/09/asp2003 09so_l/asp200309so_l.asp
The example uses Excel but it should still be helpful to you.
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able- consulting.com

"Yuri Vanzine" <yp*@tft.com> wrote in message
news:1a****************************@phx.gbl...
In asp we can run VBSCRIPT client-side which allows
for 'easy' :?) ms office COM object instantiation. How do I access a Word object in ASP.NET on the client side?

I would like to do spell checking from a web-based wysiwyg editor and I am limited to using ms word from the client, server-side word automation is out of the question for
several important reasons
(http://support.microsoft.com/default.aspx?
scid=http://support.microsoft.com:80/support/kb/articles/Q2 57/7/57.asp&NoWebContent=1) . Although this
(http://www.codeproject.com/aspnet/wordapplication.asp)
article helps a little bit.

Any help will be appreciated!

Thanks,

yv

.

Nov 18 '05 #4

Be sure to check if object creation was successful, in case the client was
not able to create the Word object.

if (word==null)
// do it
else
// notify user to install word ;-)

otherwise your page will give your user some ugly looking output....

-= Maarten van Stam =-
aa******@REMOVETHISFORNOSPAMhotmail.com

<an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Thanks! As a follow-up, this works when you enable unsafe
activeX in IE:

<script language="javascript">
var word = new ActiveXObject("Word.Application");
word.Visible = true;
word.Documents.Add("Normal", false, 0);
var range = word.ActiveDocument.Range(0, 0);
range.InsertBefore("hey testing this");
range.Font.Name = "Arial";
range.Font.Size = 24;
range.InsertParagraphAfter();
word.Quit();
</script>
-----Original Message-----
Take a look at the client side example in this article

(near the end):
http://www.aspnetpro.com/NewsletterA...003/09/asp2003

09so_l/asp200309so_l.asp

The example uses Excel but it should still be helpful to

you.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-

consulting.com


"Yuri Vanzine" <yp*@tft.com> wrote in message
news:1a****************************@phx.gbl...
In asp we can run VBSCRIPT client-side which allows
for 'easy' :?) ms office COM object instantiation. How do I access a Word object in ASP.NET on the client side?

I would like to do spell checking from a web-based wysiwyg editor and I am limited to using ms word from the client, server-side word automation is out of the question for
several important reasons
(http://support.microsoft.com/default.aspx?
scid=http://support.microsoft.com:80/support/kb/articles/Q2 57/7/57.asp&NoWebContent=1) . Although this
(http://www.codeproject.com/aspnet/wordapplication.asp)
article helps a little bit.

Any help will be appreciated!

Thanks,

yv

.

Nov 18 '05 #5
Hmmm, this should be ... was a bit to hasty entering the code ;-)

if (word==null)
// notify user to install word ;-)
else
// Do it

-= Maarten van Stam =-
aa******@REMOVETHISFORNOSPAMhotmail.com

"Joe Dokus" <no****@nospamnospamnospam.com> wrote in message
news:uu**************@TK2MSFTNGP10.phx.gbl...

Be sure to check if object creation was successful, in case the client was
not able to create the Word object.

if (word==null)
// do it
else
// notify user to install word ;-)

otherwise your page will give your user some ugly looking output....

-= Maarten van Stam =-
aa******@REMOVETHISFORNOSPAMhotmail.com

<an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Thanks! As a follow-up, this works when you enable unsafe
activeX in IE:

<script language="javascript">
var word = new ActiveXObject("Word.Application");
word.Visible = true;
word.Documents.Add("Normal", false, 0);
var range = word.ActiveDocument.Range(0, 0);
range.InsertBefore("hey testing this");
range.Font.Name = "Arial";
range.Font.Size = 24;
range.InsertParagraphAfter();
word.Quit();
</script>
-----Original Message-----
Take a look at the client side example in this article

(near the end):
http://www.aspnetpro.com/NewsletterA...003/09/asp2003

09so_l/asp200309so_l.asp

The example uses Excel but it should still be helpful to

you.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-

consulting.com


"Yuri Vanzine" <yp*@tft.com> wrote in message
news:1a****************************@phx.gbl...
> In asp we can run VBSCRIPT client-side which allows
> for 'easy' :?) ms office COM object instantiation. How

do
> I access a Word object in ASP.NET on the client side?
>
> I would like to do spell checking from a web-based

wysiwyg
> editor and I am limited to using ms word from the

client,
> server-side word automation is out of the question for
> several important reasons
> (http://support.microsoft.com/default.aspx?
>

scid=http://support.microsoft.com:80/support/kb/articles/Q2
> 57/7/57.asp&NoWebContent=1) . Although this
> (http://www.codeproject.com/aspnet/wordapplication.asp)
> article helps a little bit.
>
> Any help will be appreciated!
>
> Thanks,
>
> yv
.


Nov 18 '05 #6
Hi All

I tried to display print dialog for word, but it didn't work. I tried with the following code.

var word = new ActiveXObject("Word.Application");

word.Visible = true
var pause = 0
var nopause = 1
var wdDialogFilePrint = 88
word.Documents.Open("C:\\MyDoc.doc")
var dialog = word.Dialogs(wdDialogFilePrint)
var button = dialog.Show(1)

word.Quit()

Will anybody help me in displaying the print dialog and sending the word document to the selected printer using javascript

Thanks in Advance.
Siva

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
2
by: Raquel | last post by:
How do I know whether the 'runtime client' and the 'application development client' are installed on my machine? When I issue the command "db2licm -l", it gives the following output: Product...
2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
0
by: Harley | last post by:
Hello, I am just learning the tcp/ip functions etc under vb.net so please look over me if this is obviouse. I have been all over looking into any functions that I didn't totaly understand and...
8
by: Ankit Aneja | last post by:
i am doing here some some socket-client work in C# windows service it is working fine for multiple clients now i want to limit these multiple clients to 25 for example i want that when service...
2
by: Delmar | last post by:
I need to build Web Application that will generate a client to execute some operations. Each client has running silent application. Maybe somebody can advice me what can I do ? Thank you.
14
by: Ankit Aneja | last post by:
The code of classes given below is for server to which clients connect i want to get ip address of client which has connected pls help how can i get //listen class public class listen {
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
0
by: khu84 | last post by:
Here is client server very simple code, seems to work with telnet but with with web client code gives blank output. Following is the server code:- <?php function...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.