Groups | Blog | Home
all groups > dotnet faqs > september 2005 >

dotnet faqs : MS-Word in VB.Net



Gary NO[at]SPAM FAA
9/20/2005 9:21:02 AM
I have a VB.Net program in which I would like to call MS-Word to open a
template. I followed the instructions here
http://support.microsoft.com/default.aspx?scid=kb;en-us;316383 but am
encountering a few problems.
#1) My 'Imports' statement only allows Microsoft.Office.Core, and not
"Microsoft.Office.Interop.Word", as shown in the example.
#2) When executing my solution, the following error is generated:

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.

The program errors on the statement: Private WordApp As New
Word.ApplicationClass

Can anyone shed any light to the problem? I have imported the Word 10.0 COM
Thomas Scheidegger [MVP]
9/21/2005 12:00:00 AM
Hi

[quoted text, click to view]


http://support.microsoft.com/kb/257757/en-us


"Microsoft does not currently recommend, and does not support,
Automation of Microsoft Office applications from any unattended,
non-interactive client application or component (including ASP..."





--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/

Gary NO[at]SPAM FAA
9/21/2005 6:57:03 AM


[quoted text, click to view]

But if you read further, Microsoft does have workarounds. I have been
reading up on the workarounds, and they include how NOT to set up Word as an
anonymous user, which is what causes problems and potential crashes. It was
brought to my attention last week that .Net can be used to build Word
Documents or even an Adobe Document. I am looking for someone who has
DC
10/6/2005 12:54:47 PM
if you are targetting Office 2003, you can use WordML . You can create an
XML document on the server side, fill it with data, and drop it down to the
client. The client will open it in Word 2003. No automation of Word
necessary on the server-side.

http://msdn.microsoft.com/msdnmag/issues/03/11/XMLFiles/

http://msdn.microsoft.com/library/en-us/WordXMLCDK/html/cdkServerSampleLong_HV01116151.asp

-Dino



[quoted text, click to view]

AddThis Social Bookmark Button