Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting A Line Break (Not A Paragraph Break) Programatically To A Word Document

I am using the Office Developer Tools for Visual Studio 2013 in C#. Ever since Word 2007, adding a "\n" character adds a paragraph break (which adds more space than the line break in Word). How can I add a line break to a document? I've tried "\n", "\r", and "\r\n" all of which seem to add a paragraph break.

like image 800
user3731528 Avatar asked Jun 12 '14 20:06

user3731528


1 Answers

It turns out that Word uses Vertical Tabs for its line breaks. I was able to add them using the "\v" character to ranges. See What is a vertical tab? for more details.

like image 162
user3731528 Avatar answered Oct 06 '22 00:10

user3731528