473,320 Members | 2,146 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,320 software developers and data experts.

Client side Automation

I have tried a server-side automation and it's giving me problems that I
couldn't solve..
Now, I'm switching to client side automation and I was following this example:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp
but to get it working I had to "Go to the Security tab, select Local
intranet, and click on the Custom Level button. Find the setting titled
"Initialize and script ActiveX controls not marked as safe" and change the
selection either to Enable or Prompt."
but this application will be distributed for different clients and I can't
keep doing this in every machine to get it work!? is there a solution for
that?
Cheers
May 1 '07 #1
8 1789
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:B6**********************************@microsof t.com...
>I have tried a server-side automation and it's giving me problems that I
couldn't solve..
Indeed, because Office is not designed to work this way to the extent that
Microsoft will not support any application which tries to do it:
http://support.microsoft.com/default...US;q257757#kb2
There is one simple reason why Microsoft doesn't support server-side
automation - it doesn't work! :-)
Is there a solution for that?
There is no need whatsoever to use Office Automation in ASP.NET - several
alternatives exist...

What are your requirements for interfacing with Office files...?

--
http://www.markrae.net

May 1 '07 #2
No, there is no graceful solution if your application is to be widely
distributed. That's why client side automation is really only feasible for
small to moderate sized Intranet apps.

You'll probably want to use one of the other techniques I mentioned in the
article (but not server side automation.)

If you need to do anything fancy you could save yourself time and headaches
by using one of these 3rd party components:
http://SteveOrr.net/reviews/AsposeExcel.aspx
http://SteveOrr.net/reviews/OfficeWriter.aspx

Or here's a free control I made that might be of use to you depending on
your requirements:
http://SteveOrr.net/articles/ExportPanel.aspx

Another option is to open an existing Excel file and modify it as an ADO.NET
data source:
http://groups.google.com/group/micro...1439ff12d7473d

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"Badis" <Ba***@discussions.microsoft.comwrote in message
news:B6**********************************@microsof t.com...
>I have tried a server-side automation and it's giving me problems that I
couldn't solve..
Now, I'm switching to client side automation and I was following this
example:
http://www.aspnetpro.com/NewsletterA...200309so_l.asp
but to get it working I had to "Go to the Security tab, select Local
intranet, and click on the Custom Level button. Find the setting titled
"Initialize and script ActiveX controls not marked as safe" and change the
selection either to Enable or Prompt."
but this application will be distributed for different clients and I can't
keep doing this in every machine to get it work!? is there a solution for
that?
Cheers
May 2 '07 #3
I'm trying to Mail merge an existing word documents and then save them
document somewhere.
I can't buy "Aspose" and I don't think there a free option for that, that's
why I'm trying client-side automation.
Steve has posted this link as Microsoft's free solution:
http://msdn2.microsoft.com/en-us/office/aa905533.aspx
but I don't know how it work or if it would work for office xp (v2002)!?

"Mark Rae" wrote:
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:B6**********************************@microsof t.com...
I have tried a server-side automation and it's giving me problems that I
couldn't solve..

Indeed, because Office is not designed to work this way to the extent that
Microsoft will not support any application which tries to do it:
http://support.microsoft.com/default...US;q257757#kb2
There is one simple reason why Microsoft doesn't support server-side
automation - it doesn't work! :-)
Is there a solution for that?

There is no need whatsoever to use Office Automation in ASP.NET - several
alternatives exist...

What are your requirements for interfacing with Office files...?

--
http://www.markrae.net

May 2 '07 #4
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:9B**********************************@microsof t.com...
I'm trying to Mail merge an existing word documents and then save them
document somewhere.
No problem.
I can't buy "Aspose" and I don't think there a free option for that,
that's
why I'm trying client-side automation.
You don't need client-side automation for this - see below...
Steve has posted this link as Microsoft's free solution:
http://msdn2.microsoft.com/en-us/office/aa905533.aspx
but I don't know how it work or if it would work for office xp (v2002)!?
VSTO works only for Office 2003 and 2007...
Fortunately, you don't need automation to create Word documents - you simply
use the HTML format.

1) Open up Notepad and paste the text below:

<html>
<head>
</head>
<body>
Hello World!
</body>
</html>

2) Save the file with a .doc extension, not a .txt extension, e.g. Word.doc

3) Double-click the file you just saved - Word opens it and displays it just
like a "native" Word document - it's highly likely that your users will
never know that it isn't...
So, instead of trying to create documents with MailMerge, create them with
HTML instead...

May 2 '07 #5
Yes, I've heard about this option before but:
First: I don't know how to create an html file from asp (code behind)
Second: I have to dynamically generate a table in my word document, and I
don't know how could I dynamically generate a table in the html document!!?
Cheers

"Mark Rae" wrote:
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:9B**********************************@microsof t.com...
I'm trying to Mail merge an existing word documents and then save them
document somewhere.

No problem.
I can't buy "Aspose" and I don't think there a free option for that,
that's
why I'm trying client-side automation.

You don't need client-side automation for this - see below...
Steve has posted this link as Microsoft's free solution:
http://msdn2.microsoft.com/en-us/office/aa905533.aspx
but I don't know how it work or if it would work for office xp (v2002)!?

VSTO works only for Office 2003 and 2007...
Fortunately, you don't need automation to create Word documents - you simply
use the HTML format.

1) Open up Notepad and paste the text below:

<html>
<head>
</head>
<body>
Hello World!
</body>
</html>

2) Save the file with a .doc extension, not a .txt extension, e.g. Word.doc

3) Double-click the file you just saved - Word opens it and displays it just
like a "native" Word document - it's highly likely that your users will
never know that it isn't...
So, instead of trying to create documents with MailMerge, create them with
HTML instead...

May 3 '07 #6
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:4B**********************************@microsof t.com...
First: I don't know how to create an html file from asp (code behind)
I'm assuming that by 'asp' you actually mean ASP.NET, not ASP, so:
http://msdn2.microsoft.com/en-us/library/d62kzs03.aspx
Second: I have to dynamically generate a table in my word document, and I
don't know how could I dynamically generate a table in the html
document!!?
string strWord = String.Empty;
strWord += "<html>";
strWord += "<head>";
strWord += "</head>";
strWord += "<body>";
strWord += "<table>";
strWord += "<tr>";
strWord += "<td>";
strWord += "Hello";
strWord += "</td>";
strWord += "<td>";
strWord += "World";
strWord += "</td>";
strWord += "</tr>";
strWord += "</table>";
strWord += "</body>";
strWord += "</html>";

Or you could use the StringBuilder classs:
http://msdn2.microsoft.com/en-us/lib...ngbuilder.aspx

May 3 '07 #7
Yes, thank u very mutch Mark I'm using this code and its working:
string path = @"c:\MyTest.doc";
if (File.Exists(path))
{
File.Delete(path);
}
FileStream fs = File.Create(path);
string strWord = String.Empty;
strWord += "<html>";
strWord += "<head>";
strWord += "</head>";
strWord += "<body>";
strWord += "<table>";
strWord += "<tr>";
strWord += "<td>";
strWord += "<B>";
strWord += "Hello";
strWord += "</B>";
strWord += "</td>";
strWord += "<td>";
strWord += "World";
strWord += "</td>";
strWord += "</tr>";
strWord += "</table>";
strWord += "</body>";
strWord += "</html>";
Byte[] info = new UTF8Encoding(true).GetBytes(strWord);
fs.Write(info, 0, info.Length);
fs.Close();
But the only issue is that when opening the created document, Ms Word will
pop up a message that I have to install a converter to be able to open it an
I did install it and the second message was warning me that "the current
document contains a non word components that may cause problems" and I
clicked OK anyway and the document did open.
Is there anyway to avoid those messages, or is this the way it will be!!!?
"Mark Rae" wrote:
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:4B**********************************@microsof t.com...
First: I don't know how to create an html file from asp (code behind)

I'm assuming that by 'asp' you actually mean ASP.NET, not ASP, so:
http://msdn2.microsoft.com/en-us/library/d62kzs03.aspx
Second: I have to dynamically generate a table in my word document, and I
don't know how could I dynamically generate a table in the html
document!!?

string strWord = String.Empty;
strWord += "<html>";
strWord += "<head>";
strWord += "</head>";
strWord += "<body>";
strWord += "<table>";
strWord += "<tr>";
strWord += "<td>";
strWord += "Hello";
strWord += "</td>";
strWord += "<td>";
strWord += "World";
strWord += "</td>";
strWord += "</tr>";
strWord += "</table>";
strWord += "</body>";
strWord += "</html>";

Or you could use the StringBuilder classs:
http://msdn2.microsoft.com/en-us/lib...ngbuilder.aspx

May 6 '07 #8
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:D0**********************************@microsof t.com...
But the only issue is that when opening the created document, Ms Word will
pop up a message that I have to install a converter to be able to open it
an
I did install it and the second message was warning me that "the current
document contains a non word components that may cause problems" and I
clicked OK anyway and the document did open.
Is there anyway to avoid those messages, or is this the way it will be!!!?
Puzzling - I've just run your code unmodified, and I was able to open the
resulting Word document without any warnings...

Do you have an "unusual" installation of Word...?

May 6 '07 #9

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

Similar topics

6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
0
by: Farshad | last post by:
I am trying to automate a MS word document through a C#.NET web application. I could successfully do it on the server side. I mean when the client is running my C# application it opens the Word...
1
by: Farshad | last post by:
I am trying to automate a MS word document through a C#.NET web application. I could successfully do it on the server side. I mean when the client is running my C# application it opens the Word...
6
by: Yuri Vanzine | last post by:
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...
4
by: client site dll in vbscript | last post by:
Hi i have one dll on client site,i want to use it in aspx page, on clinet site Is it possible or not .Please tell me the solution Please email me at indipren@hotmail.com Regarda Indi
2
by: SpamUsHereInstead | last post by:
Hi, I have Googled the internet beyond belief for a solution to this and keep running into obstacles: I have written an ASP application using our IIS server which retrieves data and displays...
0
by: =?Utf-8?B?QWJkaHVsIFNhbGVlbQ==?= | last post by:
Hi, I have a recordset containing some data. Using that recordset I want to populate them in a work book in differrent sheets, using client side VBScript. Previously, I used server side...
1
by: urstop | last post by:
I am trying to use word automation to generate word document with the results from the client side javascript. So is there any work around to disable the Active X warnign I get on the page? My...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.