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

Free Support Forum - aspose.com

Unable to cast object exception when opening .doc file

I am getting the following error message when I try to open a word document:

************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Byte[]'.
at Aspose.Words.Document.Ԑ(Stream ԍ, LoadFormat Ԏ, String ԏ)
at Aspose.Words.Document.Ԍ(Stream ԍ, LoadFormat Ԏ, String ԏ)
at Aspose.Words.Document..ctor(String fileName, LoadFormat loadFormat, String password)
at Aspose.Words.Document..ctor(String fileName)
at PdfWorkbench.Form1.wordToPdfConvert() in C:\Work\DocAssembly\PdfWorkbench\Form1.cs:line 66
at PdfWorkbench.Form1.btnPdfConvert_Click(Object sender, EventArgs e) in C:\Work\DocAssembly\PdfWorkbench\Form1.cs:line 49
at System.Windows.Forms.Control.OnClick(EventArgs e)

The code at line 66 is as follows:

Document doc = new Document(tbInFilePath.Text);

I have attached the document that has this problem. Note that I am able to successfully open other word documents.

Any suggestions on how to resolve this problem?



<?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 resolved.

Best regards,


I have the same problem

Does this issue resolve?



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

Thanks for your request. I just answered your question here:

Best regards,

I get the following error message when I try to follow the link you posted. Note that I am logged in when trying this.

Access Denied

You do not have permissions to perform the requested action

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

Thanks for your request. It is private thread that is why you cannot open this link.

It seems the reason of the problem is the following Custom Document Property:


As a workaround you can try removing this Property using MS Word.

Best regards,

I'd like to better understand the problm/solution to make sure I avoid this issue in the future. Is it the specific name of this property that caused the problem? In other words, as long as we avoid properties with the name "_PID_LINKBASE", will we avoid this problem? Or is the nature of the problem more general - for instance do we need to avoid property names that start with an underscore and have a blank value?

Thank you,

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

Thanks for your inquiry. Actually, currently, I cannot provide you any additional information about this problem. This issue is still unresolved. You will be notified as soon as it is fixed.

While you are waiting for the fix you can try using the workaround provided above.

Best regards,

The issues you have found earlier (filed as 16448) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.