Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4118598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:58:52+00:00 2026-05-20T22:58:52+00:00

I creating a C# application that has to create a word document. I’m using

  • 0

I creating a C# application that has to create a word document.

I’m using the Microsoft.Office.Interop.Word to do this and I’ve successfully managed to output some word documents, but creating the content trough the code is a very time consuming work.

I noted that word is able to open html pages and show it as a normal content so I created a simple test table in html and inserted it into the word document. But when I outputted the document the obvious happened: The tags where still there! Word did not format the tags as html. It just outputted exactly what I put in there.

How can I tell word to reformat the text as html?

edit: (trough the C# code of course)

edit 2: Please note that I’m parsing trough some data to make this, so I will end up with about 4 pages of the same table/html, so I will need to be able to tell word to start at the next page each time I’ve finished a loop. So a html-only method will probably not work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:58:53+00:00Added an answer on May 20, 2026 at 10:58 pm

    As requested by the OP, and to make easier for others to find this solution, here it goes the answer I posted as a comment (plus extra results from testing):

    When opening an HTML file, MS Word honors the CSS properties page-break-before and page-break-after. There is a caveat, however:

    On “Web design” view, page-breaks are never shown (this doesn’t mean that they aren’t there), just like browsers don’t “show” them. And Word opens html files on Web design view by default (which quite makes sense). You need to print the document or switch to some other view (typicall “Print design”) to see your breaks in all their glory.

    So, saving an HTML file with a .doc extension is a viable solution (also tested: Word opens it properly despite of the extension).

    Note: all the testing was done on MS Word 2003 using this snippet: <html>asdf<br style="page-break-before: always;">new page!</html>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an application that has a ASP.NET Web API interface using the Self
I am creating a business application that has a variable width sidebar and content
I am creating an ASP.NET MVC application that has postcode lookup functionality. I capture
Here's something that has been bugging me... I am currently creating an application for
I am creating a web application that will have many users. Each user has
I am creating an application that works like the 'wizard' component of some microsoft
I am currently creating an application that has a user, the user can follow
I'm creating an application that notifies users if a new row has been added
I have a GUI C# application that has a single button Start/Stop. Originally this
I am creating an application that uses the MS Ribbon Control. The ribbon has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.