Home > front end >  Aspose Package document not saving when using doc.save method
Aspose Package document not saving when using doc.save method

Time:02-05

I have tried below two methods and ensured that license is updated along with the correct binary. Using .net framework 4.5.2. Below using doc.save method is not working.

Option 1: doc.Save(LetterTemplateEntity.CRSC_LETTER_TEMPLATE_DESC doctype,SaveFormat.FormatDocument, SaveType.OpenInWord, this.Response);

Option 2: doc.Save(this.Response, "LetterTemplateEntity.CRSC_LETTER_TEMPLATE_DESC doctype", ContentDisposition.Inline, null);

CodePudding user response:

Check these articles, they might help you :

CodePudding user response:

Acccording to the documentation, there are several overloads of the method Document.Save() that you can use :

However make sure that you are not locking the file you read (after opening the file and executing your program at the same time).

You must use one stream (MemoryStream) for reading and another one for writing.

Also make sure Visual Studio (run as admin) have access to the location where you try to write the file at, in case you run the program from Visual Studio.

  •  Tags:  
  • Related