473,761 Members | 3,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASPX and MS Office Automation

Hi. I've seen several KBs on using .NET for MS Office Automation. But I have
a particular question: I am developing a somewhat stand-alone .ASPX page
which will need to do some relatively simple MS Office Automation (Office
2003+).

The .ASPX page is not part of a Web Forms Visual Studio project. It's just a
stand-alone file. And therefore, there is not "References " setting or
anything because there's no Visual Studio project.

My question is, can I use various <% @ Import Namespace=... %> directives to
include the proper references? In other words, is there a way to have
references included in an .ASPX page so that when ASPX automatically compiles
it, it'll have the right references?

If so, can you tell me what directives I need to include (seems like some
interop stuff is needed too, right?) at the top of my .ASPX file so that
things'll work?

Thanks.

Alex Maghen
Nov 19 '05 #1
2 1835
Hi Alex,

If you aren't working in the VS.NET IDE, you need to add references when you
compile, for example:

vbc /debug /nologo /t:library /out:bin/DataLayer.dll /r:System.dll
/r:System.Xml.dl l /r:System.Web.dl l /r:System.Data.d ll Datalayer.vb

There's info here on doing ASP.NET without VS.NET but using Web Matrix:

http://www.asp.net/webmatrix/web%20matrix_doc.pdf

Ken

"Alex Maghen" <Al********@dis cussions.micros oft.com> wrote in message
news:DE******** *************** ***********@mic rosoft.com...
Hi. I've seen several KBs on using .NET for MS Office Automation. But I
have
a particular question: I am developing a somewhat stand-alone .ASPX page
which will need to do some relatively simple MS Office Automation (Office
2003+).

The .ASPX page is not part of a Web Forms Visual Studio project. It's just
a
stand-alone file. And therefore, there is not "References " setting or
anything because there's no Visual Studio project.

My question is, can I use various <% @ Import Namespace=... %> directives
to
include the proper references? In other words, is there a way to have
references included in an .ASPX page so that when ASPX automatically
compiles
it, it'll have the right references?

If so, can you tell me what directives I need to include (seems like some
interop stuff is needed too, right?) at the top of my .ASPX file so that
things'll work?

Thanks.

Alex Maghen


Nov 19 '05 #2
Alex...

You mentioned that you've read some KB articles on automating Office from
..NET. Be sure you read KB article #257757 - "Considerat ions for server-side
automation of office" and other material that that article refers to. One
thing you will learn is that Microsoft does not recommend or support what you
(evidently) are planning to do.

There are many reasons for this recommendation that are spelled out in the
article. What I can tell you from my own practical experience is that, in
addition to inherent risks to both the security and stability of your
application, you're probably going to find that you need to come up with some
means of single-threading your automated processes. This may not be an issue
if you have an extremely small user-base. In fact, we have succedded in
building several application that support very small user communities using
both Word and Excel - but it's proven to be a real pain in the patoot.

Consider using OfficeWriter, or some other third-party product designed
specifically for the kind of appication you are building. Also consider the
fact that if you code your app to do Office Automation, you will end up
re-coding the whole thing if you decide to use OfficeWriter after learning
the hard way that it ain't gonna fly.

Good Luck

"Alex Maghen" wrote:
Hi. I've seen several KBs on using .NET for MS Office Automation. But I have
a particular question: I am developing a somewhat stand-alone .ASPX page
which will need to do some relatively simple MS Office Automation (Office
2003+).

The .ASPX page is not part of a Web Forms Visual Studio project. It's just a
stand-alone file. And therefore, there is not "References " setting or
anything because there's no Visual Studio project.

My question is, can I use various <% @ Import Namespace=... %> directives to
include the proper references? In other words, is there a way to have
references included in an .ASPX page so that when ASPX automatically compiles
it, it'll have the right references?

If so, can you tell me what directives I need to include (seems like some
interop stuff is needed too, right?) at the top of my .ASPX file so that
things'll work?

Thanks.

Alex Maghen

Nov 19 '05 #3

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

Similar topics

2
1626
by: leodippolito | last post by:
Sirs, I have an ASP.NET application with hundreds of users accessing it. One of its features is to merge a set of Word documents that are stored in a server (basically is copy contents from doc1 and append to doc2). I saw there is a Microsoft Word COM DLL to work with Office documents from inside C#. However, recently I read this article: INFO: Considerations for Server-Side Automation of Office
0
1359
by: Karel | last post by:
Hi, I have developed a vb.net application to create a mail-merged document by using Automation to word from VB.NET. I added the following reference to the application: Microsoft Office 10.0 Object Library In runtime, when I click that button, I open a word doc. I create a commandbar whith in that commandbar a combobox with a list of fields
0
1249
by: Marco Singer | last post by:
Hi all, I want to create an Office automation client for Office 97 (and newer) which should automate Access, Excel and Word. On my developer computer I have Office XP installed. In KB244167 (INFO: Writing Automation Clients for Multiple Office Versions) Microsoft tells to use the type libraries of the oldest office version the client should run with. So I copied the type library files from a Office 97 installed on another
1
5507
by: BK | last post by:
I have a .NET Solution (currently in 2003, FW 1.1) that uses Office automation for a few things (generates a Word document, dumps datagrids to Excel, etc.). One of my programmers works on the project from time to time. We always have problems when he loads up the latest version of the Solution however, and it appears to be a compatibility issue with difference in Office versions. My development platform is Xp Professional running...
12
1644
by: Tomas | last post by:
Hi, I have worked with VB.NET for half a year (semi-newbie). Currently I am looking around for some books for those that crossed the starting hurdle. There are too many books out there-make choosing, a bit of a gamble. If you have experience of good VB.NET books on general and office automattion, you could recommend, it would be greatly appreciated.
5
2286
by: =?Utf-8?B?U3R1YXJ0?= | last post by:
Hi There I have been having a play around with the following code to display a datagrid in Excel (all from Steve Orr's site): Private Sub btnTechServAccred_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTechServAccred.Click Dim AcredDT As DataTable = UserSession.Current.AcredTable Dim aExcel As New Microsoft.Office.Interop.Excel.Application
1
3223
by: =?Utf-8?B?cm9i?= | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I want to achieve this using only one Interop dll if this is possible. Tried so far:
1
2871
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I want to achieve this using only one Interop dll if this is possible. Tried so far:
10
3898
by: bill | last post by:
I have been searching everywhere AND am a bit new to vb .net/aspx, but can't seem to find anything that works. Specifically, I need to export a dataset from a webapp written in vb .net to a new excel spreadsheet with multiple tabs (each tab would contain different rows from the dataset). Does anyone have any sample code or examples I might look at? tia, Bill
0
9336
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.