When I try to use the code to combine multiple .docx files (the first listing at: Append multiple DOCX files together), I seem to be missing an assembly reference for OfficeMergeControlException.
I'm using .NET Framework 4.
Any ideas?
Thanks, Rich
When I try to use the code to combine multiple .docx files (the first listing at: Append multiple DOCX files together), I seem to be missing an assembly reference for OfficeMergeControlException.
I'm using .NET Framework 4.
Any ideas?
Thanks, Rich
There is no point throwing a custom Exception in that scenerio. Just throw an Exception
catch (Exception e)
{
throw new Exception(string.Format(CultureInfo.CurrentCulture, "Error while merging files. Document index {0}", pointer), e);
}
Or better yet dont catch an exception at all. You are losing information by changing the exception type and formatting a message.
Seems to be a custom exception. Something like:
public class OfficeMergeControlException : Exception
{
public OfficeMergeControlException(string message, System.Exception innerException) : base(message, innerException) { }
}