Line & Paragraph breaks in Word from C#

E

Evan Stone

What are the characters that one needs to use when adding line (equivalent
to Shift-Enter) and paragraph breaks (equivalent to Enter) when adding text
to Word from C# via automation?

In my initial tests, simply appending "\n" seems to produce an escape-like
character -- which is not what I'm looking for -- so I'm assuming I'm
missing something here.

Thanks!

evan stone | software engineer
 
E

Evan Stone

Well, I answered my own question by recording a macro and looking at the
resultant code that Word generated.

It looks like appending Chr(11) (or "x0B" in C#) handles the line break
issue (which is what I was _really_ after), and calling
Selection.TypeParagraph inserts a paragraph break -- which info I'll just
set aside for future use... ;)

Thanks!

evan stone | software engineer
 

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