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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:51:51+00:00 2026-06-03T06:51:51+00:00

I have figured out how to replace words in documents as this is fairly

  • 0

I have figured out how to replace words in documents as this is fairly easy using the find object. Now I am struggling with replacing the word “logo” with an actual logo image throughout a word document.

I figured I can loop through each Range in the document and say that if the word logo is found in the range, I can add a picture doing:

foreach (Range rngStory in doc.StoryRanges)
{                
    rngStory.InlineShapes.AddPicture(filename);
}

The problem is that this will add the picture to the top of the range and not exactly where the text logo is.

Does anyone have a good solution for doing this?

  • 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-03T06:51:52+00:00Added an answer on June 3, 2026 at 6:51 am

    http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.inlineshapes.addpicture%28v=office.11%29.aspx

    See the optional Range parameter

    Range

    Optional Object. The location where the picture will be placed
    in the text. If the range isn’t collapsed, the picture replaces the
    range; otherwise, the picture is inserted. If this argument is
    omitted, the picture is placed automatically.

    So I would say you query for the current position where you have you logo tag, and use that as the Range value.

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

Sidebar

Related Questions

This week I have figured out how to modify form elements in the location
I have figured out a way to change the style of tabs at run
I have figured out how to add a custom calendar within my iPhone app,
I've figured out a way to cache data (so that I won't have to
I have a resource file named filetypes.resx. Some how I figured out to bind
I have tried to figure this out and googled through a fair few stack
I've been using J for a few months now, and I find that reading
I already asked a question today : This one Now I have a code
I need to update the GroupID field to a 0. I have figured out
I am trying to only have the words print out if they occur the

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.