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 7611207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:36:43+00:00 2026-05-31T01:36:43+00:00

Word has this feature where it merges tables that are inserted together, so to

  • 0

Word has this feature where it merges tables that are inserted together, so to add two separate tables, you have to put a paragraph in between them. This has been working well, but now I need to make the paragraph go away after making the tables separate so that they’re stacked on top of each other.

var document = GetDocument(word, @"C:\Blank.docx");
object missing = System.Reflection.Missing.Value;

var paragraph = document.Paragraphs.Add(ref missing);
paragraph.Range.Text = "..."; 

var table = document.Tables.Add(paragraph.Range, 1, 1, ref missing, ref missing);
table.Borders.Enable = 1;

paragraph.Range.Collapse(Microsoft.Office.Interop.Word.WdCollapseDirection.wdCollapseEnd);
paragraph.Range.InsertParagraphAfter();
paragraph.Range.Collapse(Microsoft.Office.Interop.Word.WdCollapseDirection.wdCollapseEnd);

paragraph = document.Paragraphs.Add(ref missing);
paragraph.Range.Text = "...";
table = document.Tables.Add(paragraph.Range, 1, 1, ref missing, ref missing);
table.Borders.Enable = 1;

document.Save();

var doc_close = (Microsoft.Office.Interop.Word._Document)document;
doc_close.Close();

Marshal.ReleaseComObject(document);

The top picture shows the result of the above code. I want to remove the paragraph between the two tables but don’t know how to using the com object. One important thing to note is that to delete the paragraph in word, you have to press “Delete” and not “Backspace”. I think that is an important hint to find the correct answer.

The top picture is the result of the above code, the bottom picture is what I want.

This example makes it seem like I want to do something that could be done with a single table, but the actual application works differently and requires two different tables that are stacked on top of each other.

  • 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-31T01:36:46+00:00Added an answer on May 31, 2026 at 1:36 am

    I would try using this Lib http://docx.codeplex.com/ I found it a while back looks alot easier to use than com

    You can always use the openxml SDK for office as well but I suspect docx will be easier

    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5124

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

Sidebar

Related Questions

I have a varchar column that has data like this top<somenumber> so the word
So I have this website that has a search feature which searches a table
I'm writing a COM add-in for Word, Excel and PowerPoint. This add-in has some
I have an element that is similar to a tag (because it has word-wrap:
This one has me kind of stumped. I want to make the first word
Notepad++ has a convenient feature: if you select a word in your text (not
My android app has a two word app name, and the 2nd word doesn't
I have a problem that i've struggled with for a long time. This problem
I've got this DIV tag that has a class definition in it. <div class=clear
ReSharper has a nice feature called extend selection: by pressing CTRL+W (I think this

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.