0

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

Community
  • 1
  • 1
Rich
  • 13
  • 1
  • 4

2 Answers2

1

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.

Simon
  • 33,714
  • 21
  • 133
  • 202
  • @Rich when u get a correct answer you should mark it as correct by clicking the tick below the up down arrows – Simon May 30 '12 at 23:56
0

Seems to be a custom exception. Something like:

public class OfficeMergeControlException : Exception 
{
    public OfficeMergeControlException(string message, System.Exception innerException)  : base(message, innerException) { }
} 
Fredrik Ljung
  • 1,445
  • 13
  • 28