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

Free Support Forum - aspose.com

Illegal Characters In Path Exception When Converting A MSG to TIFF

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

We are using Aspose.Words.dll 9.1.0.0. We are converting the MSG and its attachments to TIF. During the conversion, the exception “Illegal characters in path” is being thrown. I have uploaded a problem MSG file.

Here is an example of the code we are using for the conversion:

namespace OutlookTester
{
class Program
{
static void Main(string[] args)
{
Aspose.Network.License licenseNetwork = new Aspose.Network.License();
licenseNetwork.SetLicense("Aspose.Network.lic");

Aspose.Words.License licenseWords = new Aspose.Words.License();
licenseWords.SetLicense("Aspose.Words.lic");

MapiMessage msg = MapiMessage.FromFile("Outlook.msg");

using (MemoryStream rtfStream = new MemoryStream())
{
TextWriter tw = new StreamWriter(rtfStream);
tw.Write(msg.BodyRtf);
tw.Flush();

Document doc = new Document(rtfStream);

ImageOptions imgOptions = new ImageOptions();
imgOptions.Resolution = (float)200;
imgOptions.TiffCompression = TiffCompression.Ccitt4;

for (int i = 0; i < doc.PageCount; i++)
doc.SaveToImage(i, 1, "image" + i.ToString() + ".tif", imgOptions);
}
}
}
}

Please let us know when we can expect a fix.

Thank you,

Robert

Hi Robert,


Could you please try it with the latest version of Aspose.Network for .NET 5.3.1? I checked at my end with Aspose.Words for .NET 9.1.0 and Aspose.Network for .NET 5.3.1 and I was able to extract 4 tif images with the sample code and attached msg file.

I tested on Windows 2008 Server R2, Visual Studio 2008, .NET framework 3.5 and used the Aspose dlls from .NET 3.5 folder

Hello,

Yes, we found out the problem and it is solved.

Thank you.