Hello, I'm using UI for Winforms on a VSTO outlook plug-ins project. Some Email save to word doc without a problem but some get this error - "Value cannot be null.\r\nParameter name: data".
Here is my code.
var saveAsWord = new SaveAsWord(filePath, _Mail.HTMLBody, _Mail.Subject);
saveAsWord.SaveToWord();
public void SaveToWord()
{
try
{
var provider = new HtmlFormatProvider();
RadFlowDocument document = provider.Import(TextBody);
var providerDocx = new DocxFormatProvider();
using (Stream output = new FileStream(SaveFileTo, FileMode.OpenOrCreate))
{
providerDocx.Export(document, output);
}
}
catch (Exception ex)
{
LogError.LogErrorMessage(ex);
}
}
Here is my code.
var saveAsWord = new SaveAsWord(filePath, _Mail.HTMLBody, _Mail.Subject);
saveAsWord.SaveToWord();
public void SaveToWord()
{
try
{
var provider = new HtmlFormatProvider();
RadFlowDocument document = provider.Import(TextBody);
var providerDocx = new DocxFormatProvider();
using (Stream output = new FileStream(SaveFileTo, FileMode.OpenOrCreate))
{
providerDocx.Export(document, output);
}
}
catch (Exception ex)
{
LogError.LogErrorMessage(ex);
}
}