Program with Borders in Style object (Word)

B

Brian Wong

Hi,

I am not sure rather I post in the right newgroup. If not, can anyone
tell me where I should post this question. Thanks.

I have trying to write a program in C# which extracts all the formatting
styles form a word document. However I got a problem with extracting paragpah
borders defined for a style. I have defined a style called "Note[Deanger]",
for this style, I have set the "Border Setting" to Box. When I run my
program, I use the following codes to extract the border style:

Word.Style style = wordDoc.Styles.Item("Note[Danger]");
border = style.Borders.Item(Word.WdBorderType.wdBorderTop);

the above code does return the correct border object to me, however, the
border does not contains any information about LineStyle, Color etc. Does
aynone know why it is like this? the Word.WdBorderType.wdBorderRight,
Word.WdBorderType.wdBorderLeft, Word.WdBorderType.wdBorderBottom all have the
same problem.
 
K

Klaus Linke

Hi Brian,

I don't speak C#, but since you've gotten no answer yet...

Looks like you are using reserved names (style, border) as variable names.
If that wasn't the problem, please post back!

Greetings,
Klaus
 

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