PC Review


Reply
Thread Tools Rate Thread

applying irm permission in asp .net

 
 
Raan
Guest
Posts: n/a
 
      15th Oct 2007
Hi,
I can open, edit,save the file,but I can not apply IRM to Word in
asp.net.

my code likes this:


Doc = WordApplication.Documents.Open(); // open
WordApplication.Selection.TypeText("edit it");// edit it
// Doc.Permission.Add(userid, permission, expireddate) // apply IRM
Doc.Save(); // save
WordApplication.Application.quit();// quit


if i uncomments the Permission.Add code, it will throws exception
message


Word cannot save or create this file. Make sure that the disk you want
to
save the file on is not full, write-protected, or damaged.
(C:\test\test.doc)


The code works fine in Windows App,but fails in asp.net.


I have full-control access to the doc, as I have do the configuration
according to http://support.microsoft.com/kb/288366/
And my web application runs under the admin account.


Can anyone give me some clues? Thanks!

Raan

 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      15th Oct 2007
"Raan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Doc = WordApplication.Documents.Open(); // open


Server-side Office automation isn't supported by Microsoft because it
doesn't work:
http://support.microsoft.com/default...US;q257757#kb2

> I have full-control access to the doc, as I have do the configuration
> according to http://support.microsoft.com/kb/288366/
> And my web application runs under the admin account.


That's, possibly, the worst thing you can do in terms of (lack of)
robustness. I suggest you read that article again, noting specifically:

"We do not recommend or support Automation to a Microsoft Office application
from an unattended user account."

"Caution Automation of any Office application from an unattended,
non-interactive user account is risky and unstable. A single error in code
or configuration can result in a dialog box that can cause the client
process to stop responding (hang), that can corrupt data, or that can even
crash the calling process (which can bring down your Web server if the
client is ASP)."

"Warning Office was not designed, and is not safe, for unattended execution
on a server. Developers who use Office in this manner do so at their own
risk."

Use this instead: http://www.aspose.com/Products/Aspos...s/Default.aspx


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
applying permission to Program Files =?Utf-8?B?d3JldGNoZWQ=?= Windows Vista Administration 3 17th Nov 2007 07:15 PM
Determining permission to another mailbox using RDO when user isin permission group tEst Microsoft Outlook Program Addins 3 24th Aug 2007 10:19 PM
How give copy permission on a file without read permission Sam Windows Networking 1 19th Jan 2007 03:06 PM
Delegate permission after applying SP2 Sandy Microsoft Outlook 0 28th Apr 2004 07:30 PM
You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permission. Manoj Keswani Windows XP Networking 1 4th Oct 2003 03:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:17 PM.