I am trying to use the WordDocumentWriter. I am struggling to understand why the control is not available . How can I add the reference. I see it as if it is added, but I can not see the control in my Toolbox..
Imports Infragistics.Win.UltraWinGridImports Infragistics.Win.LayoutImports Infragistics.Win.UltraWinGrid.WordWriterImports System.Text.RegularExpressionsImports Infragistics.Documents.ExcelImports Infragistics.Documents.IO '' This gives an green line error ..Dim wordDocWriter As WordDocumentWriter = WordDocumentWriter.Create("C:\Samples_Projects\GridDataInWord.docx")wordDocWriter.StartDocument()wordDocWriter.StartParagraph()Dim font As Infragistics.Documents.Word.Font = wordDocWriter.CreateFont()font.Bold = Truefont.Underline = Underline.Thickfont.ForeColor = Color.Red
Hello Marius,
You are on the right way of using WordDocumentWriter. Please note WordDocumentWriter is an abstract class in Infragistics WinForms library and it is not a control or component. This is why you cannot see is in your toolbox. More about WordDocumentWriter you can find by following next link http://help.infragistics.com/Doc/WinForms/current/CLR4.0/?page=Word_About_Infragistics_Word_Library.html
Please note WordDocumentWriter is abstract class and does not support direct instantiation. To create an instance of a derived class you need to use Create method. One more point – each time you start document or paragraph by StartDocument() or StartParagraph() methods when you finish with them you need to call EndParagraph() and EndDocument() in order to avoid an exception.
This row Imports Infragistics.Documents.IO gives you an error as Infragistics.Documents.IO library does not contains any public methods.
Please find attached a sample solution implementing MS Word document creation via WordDocumentWriter.
Please let me know in this is what you are looking for or if I am missing something.
Thank you for contacting Infragistics.
Hi , thanks for your response.
Some questions:
I pasted the code below.
Private Sub WriteParagraph(writer As WordDocumentWriter, text As String, font As Infragistics.Documents.Word.Font)
' Open a paragraph writer.StartParagraph()
' Add a text run with the specified text and font writer.AddTextRun(text, font)
' Close the paragraph. writer.EndParagraph()End Sub
It says that the WordDocumentWriter has not been defined!
I am just checking about the progress of this issue. Let me know if you need my further assistance on it.
Thank you for using Infragistics Components.