I am new to aspose words and I want to know how to use aspose.words in windows forms application. How can I create a new document for the user to type in and save. Is there a control to put on the form. I am confused.
Hi there,
Thanks for your inquiry. Firstly, please check my reply at following thread :
Secondly, please read Document Loading Overview from following documentation link.
The Document represents a Word document. The Document is a central object in the Aspose.Words library.
To load an existing document in any of the LoadFormat formats, pass a file name or a stream into one of the Document constructors. To create a blank document, call the constructor without parameters.
Use one of the Save method overloads to save the document in any of the SaveFormat formats. To draw document pages directly onto a Graphics object use RenderToScale or RenderToSize method.
To print the document, use one of the Print methods.
Following code example shows how to create a simple table using DocumentBuilder with default formatting in an empty document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// We call this method to start building the table.
builder.StartTable();
builder.InsertCell();
builder.Write("Row 1, Cell 1 Content.");
// Build the second cell
builder.InsertCell();
builder.Write("Row 1, Cell 2 Content.");
// Call the following method to end the row and start a new row.
builder.EndRow();
// Build the first cell of the second row.
builder.InsertCell();
builder.Write("Row 2, Cell 1 Content");
// Build the second cell.
builder.InsertCell();
builder.Write("Row 2, Cell 2 Content.");
builder.EndRow();
// Signal that we have finished building the table.
builder.EndTable();
// Save the document to disk.
doc.Save(MyDir + "DocumentBuilder.CreateSimpleTable Out.doc");
Hope this answers your query. Please let us know if you have any more queries.
Hi Experts!
My problem is I am developing an operations application for my client and they want to create word, excel and powerpoint in the application and save into a sql server database but not on a hard disk.
I tried TXT TextControl and it works fine that way but they don't have excel and powerpoint solutions like yours. My concern now is how do I use aspose to allow the users type and or edit word, excel and powerpoint document in the windows forms like the txt textcontrol does? All the samples shown doesn't help in anyway.
Hi there,
Thanks for your inquiry.
Please note that Aspose.Words for .NET is a class library that enables your applications to perform a great range of document processing tasks. Aspose.Words supports DOC, DOCX, RTF, HTML, OpenDocument, PDF, XPS, EPUB and other formats. With Aspose.Words you can generate, modify, convert, render and print documents without utilizing Microsoft Word®. So, it does not offer any UI or web control for performing these document processing tasks.
For more information, please go through the documentation below:
http://www.aspose.com/docs/display/wordsnet/Introducing+Aspose.Words+for+.NET
You can load and save documents to database. Please read following documentation link for your kind reference.
http://www.aspose.com/docs/display/wordsnet/How+to++Load+and+Save+a+Document+to+Database
I am moving this forum thread to Aspose.Total forum. My colleagues from Aspose.Slides and Aspose.Cells team will reply you shortly about your query.
Hi,
Well, if you need to manipulate Excel document in WYSIWYG (visual manner) on Winform applications/solution, we have a control named Aspose.Cells.GridWeb (provided by Aspose.Cells for .NET) that you may use. The control does provide the feature called DataBinding that you may make use of it. For complete reference, please install our latest Aspose.Cells for .NET v7.5.3, you may download it here:
After installing the product, you will also get Aspose.Cells.GridDesktop @ its installation directory. For complete reference, we recommend you kindly see / browse the featured demo solution in your VS.NET
(e.g see the FormDataBinding.cs/vb @ “\Aspose\Aspose.Cells for .NET\Demos\C Sharp\Windows\GridDesktop.Demos\Features” directory).
Let us now if I can be of any further help.
Thank you.
Hi,
I am representing Aspose.Slide and I will help you for Aspose.Slides related part. Aspose.Slides offers to save the presentation to stream. You can convert the stream to byte array and save that to database easily. Conversely, you can load the presentation stored in database in the form of byte array to memory stream and loading the presentation in memory stream using Aspose.Slides.
You can use
Aspose.Slides to access even every single slide of source presentation,
copy that independently in some temporary PresentationEx object and then
saving the single slide presentation in memory stream. Then converting
that memory stream to byte array and populating that to database along
with file extension in separate field for future retrieval of the byte
array. When you will need to access that slide added in database, you
will have to load the byte array and convert that to memory stream. Then
load the memory stream back in to PresentationEx. I hope this will
help. I have shared the sample code for exporting individual slide to
Memory Stream for your kind reference.
public static void changetoMemStream(){PresentationEx origPres = new PresentationEx(“SamplePres.pptx”);PresentationEx tempPres = null;foreach (SlideEx slide in origPres.Slides){tempPres = new PresentationEx();tempPres.Slides.AddClone(slide);tempPres.Slides.RemoveAt(0);MemoryStream mem = new MemoryStream();tempPres.Save(mem , Aspose.Slides.Export.SaveFormat.Pptx);mem.Position=0;byte[] buffer = new byte[mem.Length];mem.Write(buffer, 0, (int)mem.Length);}}
Please share, if I may help you further in this regard.
Many Thanks,