We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SaveType not available in Apose.Words 9.1 for .NET 3.5?

I'm using Aspose.Words 9.1 and the net3.5_ClientProfile DLLs.

When I try to save I'm not able to give it 4 arguments like the documentation says (below)

doc.Save("PersonalizedLetter Out.doc", .Doc, SaveType.OpenInBrowser, Response);

if I use the net2.0_ClientProfile DLLs it works fine.

Is this a bug in 3.5 or am I doing something wrong ?

Hello<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.

As a workaround of this problem, please try using the following code:

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.Write("Hello world!!!");

MemoryStream stream = new MemoryStream();

doc.Save(stream, SaveFormat.Doc);

Response.Clear();

//Specify the document type.

Response.ContentType = "application/plain";

//Other options:

//Response.ContentType = "text/pdf"

//Response.ContentType = "text/html"

//Specify how the document is sent to the browser.

//Response.AddHeader("content-disposition","inline; filename=MyDocument.pdf");

//Another option could be:

Response.AddHeader("content-disposition", "attachment; filename=out.doc");

//Get data bytes from the stream and send it to the response.

byte[] bytes = stream.GetBuffer();

Response.BinaryWrite(bytes);

Response.End();

Best regards,

.NET 3.5 Client Profile excludes System.Web and therefore HttpResponse is not available. This is entirely by design. Use the Aspose.Words.dll for full .NET 3.5.

So how can I make it open the file in word after generating it ?

The code suggested gives me a (accordring to Word 2010) corrupt docx file:

MemoryStream stream = new MemoryStream();
oDoc.Save(stream, SaveFormat.Docx);

Response.Clear();
Response.ContentType = "application/plain";
Response.AddHeader("content-disposition", "attachment; filename="+fileName+"");
byte[] bytes = stream.GetBuffer();
Response.BinaryWrite(bytes);
Response.End();

Note : I'm using Aspose.Words.dll from the "net3.5_ClientProfile" folder in the Aspose.Words.zip file.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. ASP.NET applications work under .NET 1.1 or .NET 2.0. To make sure, please check IIS settings. As you can see you can select only .NET 1.1 or .NET 2.0 (see the attached screenshot).

In your case, you should use Aspose.Words for .NET 2.0 in your ASP net application. In this case you can use code like the following:

doc.Save("test.docx", SaveFormat.Docx, SaveType.OpenInApplication, Response);

Response.End();

Best regards.

I am upgrading an application and have run into the same errors: "SaveType is not a member of Words" and "SaveType is not a member of Cells." This led me to this thread, but I am confused as to whether or not there is a working solution. I am getting the same errors whether I use the .net 2.0 dll or the .net 3.5 dll (Words 9.4.0).

How do I cause a Words-created document to open in Word on the client (the way it used to)?

Thanks for your help!

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Now, you should use ContentDisposition instead of SaveType. Please see the following link for more information:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.document.save_overload_6.html

Best regards,

I have this issue where where doc.Save() only takes two arguments. I don't understand this post:

romank:
.NET 3.5 Client Profile _excludes_ System.Web and therefore HttpResponse is not available. This is entirely by design. Use the Aspose.Words.dll for full .NET 3.5.

Where do I get the full .NET 3.5 dll?

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. One of the Aspose.Words' Document.Save overloads allows to save to a System.Web.HttpResponse object. This useful method sends a document to the client browser. But System.Web is not available in the .NET Framework 3.5/4.0 Client Profile so it was not possible to use Aspose.Words to target the Client Profile.

In your case, you should use Aspose.Words for .NET 2.0 in your ASP net application.

Best regards,