473,420 Members | 1,574 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,420 software developers and data experts.

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 1818
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.dll /r:System.Web.dll /r:System.Data.dll 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********@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.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 - "Considerations 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
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...
0
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...
0
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...
1
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...
12
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...
5
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,...
1
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...
1
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...
10
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...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
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...

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.