TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ghorpad72
NA
2
0
Inserting Page Breaks in a Word Document - c# Net
Nov 9 2005 9:44 AM
am new to c# and .Net programming.
I have multiple pages in my word document and would like to insert page breaks as needed.
I know how to create a word document, but am facing diffculty in trying to insert a page break after a paragraph.
For example, If there are 6 paragaphs in the document and i need a pagebreak after the 2nd, 4th & 6th paragraphs and if i place the below mentioned code after the 2nd, 4th & 6th paragraphs, The pagebreak gets introduced after the first paragraph, period. I do not get the other page-breaks.
I am using the same range selection (wrdRng). I am not sure if this is the right way of doing it.
It would be great if i could get a pointer in the right direction.
Thank you in advance !
This is the code i am using :
wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
object oPageBreak = Word.WdBreakType.wdPageBreak;
wrdRng.InsertBreak(ref oPageBreak);
Reply
Answers (
0
)
How to use the FileSystemWatcher class in .Net to monitor directories on a Server
How to repeat Column Headers if table overflows into the next page ?