I'm using a DOCX (Word2010) for a mailmerge template. The new document is generated, ok but I'm having a problem saving it. If I save using anything other than FormatType.Word2010 it fails. I would really like to support FormatType.Automatic so i could support templates in any word document format.
Object reference not set to an instance of an object.
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_XmlParaItem(XmlParagraphItem item)
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_item(ParagraphItem item)
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_items(ParagraphItemCollection items)
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_Paragraph(WParagraph para, Boolean lastSection)
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_bodyitem(TextBodyItem item, Boolean lastSection)
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_body_items(BodyItemCollection items, Boolean isLastSection)
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_section(WSection section)
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_sections(WSectionCollection sections)
at Syncfusion.DocIO.DLS.DocxXmlWriter.Build_DLS(WordDocument doc)
at Syncfusion.DocIO.DLS.DocxWriter.Write(Stream stream, IWordDocument document)
at Syncfusion.DocIO.DLS.DocxWriter.Write(String filename, IWordDocument document)
at Syncfusion.DocIO.DLS.WordDocument.SaveDocx2007(String fileName)
at Syncfusion.DocIO.DLS.WordDocument.Save(String fileName, FormatType formatType)
at iCatalyst.Output.SyncFusion.GenerateDocumentSyncFusion.Generate(String documentTemplateFilePath, String fullPathToSaveTo, Object dataSource) in E:\Users\Larry Kloepping\My Documents\Visual Studio 2010\Projects\EchoRidge\icatERP\iCatalyst\trunk\iCatalyst.Output.SyncFusion\GenerateDocumentSyncFusion.cs:line 83
at iCatalyst.Output.DocumentManagement.Generate(String documentTemplateFilePath, Object dataSource, String outputExtension) in E:\Users\Larry Kloepping\My Documents\Visual Studio 2010\Projects\EchoRidge\icatERP\iCatalyst\trunk\iCatalyst.Output\DocumentManagement.cs:line 208
at iCatalyst.Output.DocumentManagement.GenerateFromTemplate(EntityRepository repository, String documentTemplateName, Object dataSource, EntityBase parentEntity, Guid parentKey, String documentTypeName, String documentDescription) in E:\Users\Larry Kloepping\My Documents\Visual Studio 2010\Projects\EchoRidge\icatERP\iCatalyst\trunk\iCatalyst.Output\DocumentManagement.cs:line 285
at iCatalyst.Facilities.PolicyCoveragesViewModel.b__38() in E:\Users\Larry Kloepping\My Documents\Visual Studio 2010\Projects\EchoRidge\icatERP\iCatalyst\trunk\iCatalyst.Facilities\ViewModels\PolicyCoveragesViewModel.cs:line 611
at iCatalyst.Common.RelayCommand.Execute(Object parameter) in E:\Users\Larry Kloepping\My Documents\Visual Studio 2010\Projects\EchoRidge\icatERP\iCatalyst\trunk\iCatalyst.Common\RelayCommand.cs:line 147
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)