Word 2003 and dotNet

N

neomat8

Hi,

I'm trying to develop a dotNet application that generates a Word2003 document.

This is part of my code but it launches an exception,

If oApplication Is Nothing Then
oApplication = New Word.ApplicationClass
End If
oApplication.Visible = False
oApplication.Activate()

Dim missing As Object
oDocument = New Word.Document --> InteropServices.COMException

Could you give me a tip to solve this problem? What is wrong?

Thanks a lot,

Neomat8
 
C

Cowboy

I am not familiar with the Office objects, but here are some possibilities I
can think of:

1. Word doc is not created directly, but through the application, something
like

oDocument = oApplication.Document("info.doc")

To figure if this is the case

2. COM object not properly registered in .NET application
3. Improper permissions to create DOC. This is common in web applications.
The IUSR and ASP.NET worker process often need additional permissions. Be
careful if this is the case, as you can create a security hole.

I am not overly fond of using the Office objects directly from a web
application, personally, and prefer third party components. There are a
couple of reasons:

1. Installing office on a web server adds additional security risks
2. The office components are slow on servers (they are designed as client
software)

Software Artisans has a component called WordWriter that is quite nice.
There is a native .NET version available:

http://officewriter.softartisans.com/officewriter-189.aspx

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 

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

Forum statistics

Threads
473,775
Messages
2,569,601
Members
45,182
Latest member
alexanderrm

Latest Threads

Top