We’re evaluating the Aspose.Word product and it’s been working great, but we have encountered an error every so often that seems as if the template file we are using is locked and can’t be accessed. Here is the exception error we are getting:
The process cannot access the file “\Invoices\Templates\Blank.dot” because it is being used by another process.
Here is the code that is opening the file. It has the clone command in it because I thought this would help in keeping the template file available, but it didn’t help:
Public Class CNetAsposeWord
Private doc As Document
Private m_Bookmarks As BookmarkCollection
Public Sub New()
End Sub
Public Sub CrateNewDoc_FromTemplate(ByVal FileName As String, ByVal TemplateName As String)
Dim srcDoc As New Document
srcDoc = New Document(TemplateName, LoadFormat.Doc, String.Empty)
doc = srcDoc.Clone()
doc.IsTemplate = False
srcDoc = Nothing
End Sub
Public Sub OpenAspose_ExistingFile(ByVal fileName As String)
doc = New Document(fileName, LoadFormat.Doc, String.Empty)
doc.IsTemplate = False
End Sub
Public Sub Save(ByVal FileName As String)
doc.Save(FileName)
End Sub
End Class
Any help you can offer is greatly appreciated!
Frank
This message was posted using Page2Forum from Cloning a Document - Aspose.Words for .NET and Java