Setting a Style on a Word Range (C#)

C

Cyril Mathey

Hello,

I may have missed something, but I do not manage to set a style on a range
or on the current selection using the 'Style' property. For example:

using Word = Microsoft.Office.Interop.Word;

Word.Style style = ...;
Word.Range range = ...;
range.Style = style;
// or range.Style = "Normal"

The compiler complaints that the property is not accessible and that I
should use the underlying accessor method (namely set_Style). However, this
method does not exist.

Is there a way to do this with C# ? (I have seen code samples in VB that use
the Style property, and although I have not tested them, I assume that it
works).

Thanks for any help ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top