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

  • Home
  • SEARCH
  • 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 8019013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:15:59+00:00 2026-06-04T21:15:59+00:00

I have the following method(not my program) that inserts table data to the end

  • 0

I have the following method(not my program) that inserts table data to the end of the document. I want to insert the data into a bookmark in the document. How do I reference that bookmark instead of the \endofdoc?

    private static void CreateTable(Microsoft.Office.Interop.Word.Document oWordDoc, int RowCount, int ColumnCount, string[,] TableContent)
    {
        Table oTable;
        object oEndOfDoc = "\\endofdoc";
        object missing = System.Reflection.Missing.Value;
        Range wrdRng = oWordDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
        oTable = oWordDoc.Tables.Add(wrdRng, RowCount, ColumnCount, ref missing, ref missing);


        oTable.ID = "ContentTable";
        int r, c;


        for (r = 0; r < RowCount; r++)
            for (c = 0; c < ColumnCount; c++)
            {
                oTable.Cell(r + 1, c + 1).Range.Text = TableContent[r, c];
            }


        //oTable.Rows[1].Range.Font.Bold = 1;

        oTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleThickThinLargeGap;
        oTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle;
    }
  • 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-06-04T21:16:00+00:00Added an answer on June 4, 2026 at 9:16 pm

    The following code was culled from c-sharpcorner which should get you started with dealing with bookmarks.

    //BOOK MARK FOR START OF SELECTION
    
    Object oBookmarkStart = "BookMark__Start";
    
    Object oRngoBookMarkStart = oWordDoc.Bookmarks.get_Item(ref oBookmarkDesignInfoStart).Range.Start;
    
    
    
    //BOOK MARK FOR END OF SELECTION
    
    Object oBookmarkEnd = "BookMark__End";
    
    Object oRngoBookMarkEnd = oWordDoc.Bookmarks.get_Item(ref oBookmarkDesignInfoEnd).Range.Start;
    
    
    
    //SETTING THE RANGE ON THE BOOKMARK BETWEEN TWO BOOKMARKS
    
    Word.Range rngBKMarkSelection = oWordDoc.Range(ref oRngoBookMarkStart, ref oRngoBookMarkEnd);
    
    
    
    //SELECTING THE TEXT
    
    rngBKMarkSelection.Select();
    rngBKMarkSelection.Delete(ref oMissing, ref oMissing);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have the following method not show a warning about using raw
Constructor and method not working as expected in Java program I have the following
I have the following method which is not capturing anything from the user.If I
I have the following method that is replacing a pound sign from the file
I have the following method that is supposed to be a generic Save to
I have a program that creates a notification if the application is not running.
Not clear what is going on: I have the 2 following lines that works
I have the following lua table : t = {name=sandy, age=22, major=computerScience} I want
Lets say we have a following program where in its Start method, it delegates
I am working on a ruby program and have run into the following problem.

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.