Access denied error when saving


#1

My Code

Dim word As Word = New Word
Dim doc As Document = word.Open(“C:\Reports\BookmarkDemo.doc”)
mobjData = New cxDbAccess
’the mObjData is an instance of a data access class on my box. FYI
Dim dsTest As New DataSet, tables As DataTable
dsTest = mobjData.dataAccess(“select * from tblLetterTemplate where ID=2”)

For Each tables In dsTest.Tables
With dsTest.Tables(0)
doc.MailMerge.Execute(New String() {“Greeting”, “Body”}, _
New Object() {.Rows(0)(“Greeting”), .Rows(0)(“Body”)})
End With

doc.Save(“PersonalizedLetter.doc”)
Next


My permissions are fully allowed on the document, as well as the folder, but I still get the error.

If anyone has an idea, please let me know. Thanks in advance.

PS my stack trace if anyone is interested
[Exception: Access Denied]
fz.a(String A_0, Int32 A_1)
fp.b(String A_0)
ec.a(b6 A_0, String A_1)
Aspose.Word.Document.Save(String fileName, SaveFormat fileFormat)
Aspose.Word.Document.Save(String fileName)
aspOseWord.WebForm1.SaveTheWordDoc() in c:\inetpub\wwwroot\aspOseWord\WebForm1.aspx.vb:55
aspOseWord.WebForm1.btnSaveDoc_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\aspOseWord\WebForm1.aspx.vb:63
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1277


#2

You don’t seem to indicate path for saving the file. While running in an ASP.NET application I’m not exactly sure where it tries to file by default. I’d suggest you specify the path where you want the file saved.


#3

Is there an update on this issue? I'm having the same problem. I have tried specifying the location, but get the same error.


#4

If access denied happens on Aspose.Word.dll, then you need to stop (maybe restart) MS Index Server. This error might also be caused by ASP.NET temporary cache. Please search for “access denied” in this forums, there is no hard and fast answer for this problem, but it has been raised and solved a number of times.
Basically, there is nothing wrong with Aspose.Word, something must be reset or reconfigured on your machine.