We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

What code examples do you want to see?

We are writing code examples for all classes, methods and properties in Aspose.Words right now. We are going to include them in Aspose.Words 3.6 that is coming out next week.

Let us know if you want to see any particular code examples.

I’d like to see an example where you can have 2 styles in the same line of text.

Sorry, not sure what do you mean. Do you want to just apply different character styles to text that you insert into a document?

I would like to see a working Example(C#) of printing document using document viewer.

romank wrote:

Sorry, not sure what do you mean. Do you want to just apply different character styles to text that you insert into a document?

I wrote this before your team clarified my lack of understanding with the various Word style types and how Aspose.Words works with them. You can delete this request.

A lot of new code examples were added to the API Reference in Aspose.Words 3.6. Have a browse and let us know what do you think. There will be more examples added in each further release. We are still open to hear what do you want to see in examples.

Here is something to start with:

most code examples consists of creating documents from scratch.
i was more interested in document manipulation and modification i.e replacing an applied style with another on all objects supporting styles, or how to handle section break when parsing a document (splitting a section while encountering a certain condition).
actually, a tutorial would be a good thing. not just code snippets. but a how to to help people understand the mechanics and patterns used.

Sure, I don’t mean we are after code examples for the API Reference only. We are trying to understand what is out there that needs explaining. It could end up being a short example for the API Reference or it could make it a new topic or a tutorial in the Programmers Guide in Wiki.

I like the two questions that you have. Give me more of the real world context and we will make nice topics with examples for these questions. Why do you need to change styles, what sort of a document is this and what is that you are trying to produce. Same for the section break, when do you want to insert section breaks.

I do know a way to perform these tasks actually but i remember it took me some time to understand how.

My real case scenario is simple, we gave books templates to users to input text. with predefined styles. But as most programmers know you can’t trust user input and as they began either pasting text from other docs or creating new styles we had to perform a manual check/correction/error reporting which is a time consuming task.

We now try to automate that process by checking styles used for paragraphs and inline elements and fallback to predefined styles but keeping bold/italic. We also needed headers to be different when we encountered a predefined Title Style this is usually done with sections (define a new section there where we should not display header on current section first page and footer on previous section last page) .
I also would like to point out that a way around some functions should
be shown (a way to make Range.Replace() work with regex backreferences
for example, this can come in handy for number formatting in a doc, or applying standard rules like non breaking space before a double punctuation mark).

The perfect example for me would be a simple app that create a doc, populates it, insert garbage styling/data and is able to clean it up conforming to certain typographic/styling rules and reporting modifications made.
I believe this kind of example is a big plus over smaller examples as this would give a glimpse of how far the api goes and how it works.

On a side note, I’m almost finished with a prototype that does just that and would gladly share my findings. As a matter of fact if the proto proves worthy we buy the license The only thing stopping us for now is the inability to report on which page the changes were made, but i believe this is to be seen with the pagination engine. Putting aside the pagination problem, for now the proto using aspose is way better(in the way easier to code and deploy) than our vsto proto.

Was an example ever posted regarding this? I have a master document composed several documents written by different authors and want to make sure all the styles match when the final document is combined.


Thanks for your request. No there is no such example. But I think if you need that styles of master document will be used you should just use ImportFormatMode.UseDestinationStyles. Please see the following link for more information.

Best regards.