We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Chnage style in an existing document

Thread ID:

Created:

Updated:

Platform:

Replies:

63376 Jul 3,2007 12:31 PM UTC Jul 3,2007 09:04 PM UTC Windows Forms 1
loading
Tags: DocIO
Christian Nein
Asked On July 3, 2007 12:31 PM UTC

Hi,

how can I apply existing styles to some text in an existing document? Example:

object obj1 = Word.WdUnits.wdLine;
object obj2 = Word.WdMovementType.wdExtend;
selection.EndKey(ref obj1, ref obj2); // select the current line
selection.set_Style("Bissantz Heading 2"); // apply some user specific style

Anyway, I am missing the "Selection" object which is a crucial object when formatting DOC-files using MS Office InteropAssemblies. I still did not find the corresponding object of DocIO.

Thanks & best regards
Christian

Ajish [Syncfusion]
Replied On July 3, 2007 09:04 PM UTC

Hi Christian,

Thank you for your interest in Essential DocIO.

Essential DocIO supports creation of custom styles that can apply a whole group of formats in one simple task. This sample demonstrates how custom styles can be created and applied using Essential DocIO.

Here is a code snippet to create and apply custom styles.

// Create Paragraph styles
IParagraphStyle style = document.AddParagraphStyle ( "MyStyle");
style.CharacterFormat.FontName = "Bitstream VeraSerif";
style.CharacterFormat.FontSize = 10f;

// Applying style to the current paragraph.
paragraph.ApplyStyle ( "MyStyle" );

A sample demonstrating support for StylesAnd Formatting is available along with our install and it can be found at the following path

C:\Documents and Settings\{user}\My Documents\Syncfusion\EssentialStudio\5.1.1.0\Windows\DocIO.Windows\Samples\2.0\Document Formatting\StylesAndFormatting\cs

Kindly take a look and let us know if you have any other questions.

Regards,
Ajish.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;