Hello,
I have been trying to write a small program that generates a Word document using OpenXML docmentformat.
In my mainform I have a method creating the document:
' Creates a WordprocessingDocument.
Public Sub CreatePackage(filePath As String, text As String)
Using package As WordprocessingDocument = WordprocessingDocument.Create(_filename, WordprocessingDocumentType.Document)
' Add a new main document part.
package.AddMainDocumentPart()
' Create the Document DOM.
package.MainDocumentPart.Document = New Document(New Body(New Paragraph(New Run(New Text(text)))))
' Save changes to the main document part.
package.MainDocumentPart.Document.Save()
End Using
End Sub
When I run the program I get a "UnauthorizedAccessException" Access to the path 'C:\Temp' is denied.
I have tried searching the net but with 51.000 hits on this basically impossible to review them all. My settup and what I have checked so far:
* Windows 7 Pro
* Visual Studio 2010 (running as admin)
* I have admin rights on PC
* tried to add a app.manifest with
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
Any help would appreciated.