Illegal Characters In Path Exception When Converting A MSG to TIFF


We are using Aspose.Words.dll 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();

Aspose.Words.License licenseWords = new Aspose.Words.License();

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

using (MemoryStream rtfStream = new MemoryStream())
TextWriter tw = new StreamWriter(rtfStream);

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);

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


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

Thank you.