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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:09:04+00:00 2026-05-28T18:09:04+00:00

I am working on a Word 2010 addin for a word template we are

  • 0

I am working on a Word 2010 addin for a word template we are using. I have several bookmarks in the page, and their content can be changed using various wizards in the addin.

I need to add images and tables to the bookmarks now – and this works fine, but deletes the bookmark immediately afterwards. I am using the following code, passing in the bookmark.Range as a parameter.

Adding a table:

bookmark.Range.Tables.Add(bookmark.Range, rowCount, columnCount, ref _objectMissing, ref _objectMissing);

Adding an image:

InlineShape shape = bookmark.Range.InlineShapes.AddPicture(path, ref _objectMissing, ref _objectMissing, ref _objectMissing);

I need to be able to do this without deleting the bookmark, so that I can go back and replace the image if the user runs the wizard again. Any ideas how to do this would be greatly appreciated!

  • 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-28T18:09:05+00:00Added an answer on May 28, 2026 at 6:09 pm

    Both InlineShape and Table objects have a Range property that you can use to restore the bookmark, like this:

    // Keep the name of the bookmark
    string bookmarkName = bookmark.Name;
    // Insert your image, as before
    InlineShape shape = bookmark.Range.InlineShapes.AddPicture(path, ref _objectMissing, ref _objectMissing, ref _objectMissing);
    // Restore the bookmark
    Object range = shape.Range;
    yourDocumentVariable.Bookmarks.Add(bookmarkName, ref range);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a word 2007 add-in using Visual Studio 2010, everything is working
I have used the demo here. All works well. http://code.msdn.microsoft.com/Word-2010-Using-the-Drag-81bb5bff However, when I try
I'm working on a word processor-type app using the WPF RichTextBox. I'm using the
Using Visual Studio 2010 I created an Office 2010 Word add-in project that has
we can assume the user is working with Ms Word files. After the user
I'm working on a project where I can generate Word documents, one of the
I am working on a word automation project in c# and am using the
Using VBA in MS Project 2003 and working with a Word Document I try
Im working with vb.net and microsoft word using Microsoft.Office.Interop.Word and everything is fine. My
I have built template-based add ins for Word and Excel version 2003 and previous.

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.