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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:14:01+00:00 2026-06-12T10:14:01+00:00

How do ranges and selections work? If you insert something at the top of

  • 0

How do ranges and selections work?

If you insert something at the top of the page through a range, is that overridden by inserting something with selection? Does selection affect ranges?

I’m having a problem where I do inserts in this order, but the InlineShapes show up at the top of the document above the Range.Inserts. Also, the Selection.InsertBefore gets replaced by the InlineShapes.

I would like my range insert to appear above each picture, like a heading. How can this be done?

Selection.InsertBefore
**Loop**
     Range.InsertParagraphAfter
     Selection.InlineShapes.AddPicture
**End Loop** 

I’ve asked a question like this three times now with no responses. Anything would help!

EDIT:

I’m a step closer. Now, when I add my InlineShapes, I use Content.InlineShapes.AddPicture(FileName: x, range: y). Now the pictures are showing up in between paragraphs, but they are in the first cell of a table I add to the document before adding the picture. I add the table with with a collapsed range.

  • 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-12T10:14:02+00:00Added an answer on June 12, 2026 at 10:14 am

    You write:

    I've asked a question like this three times now with no responses. Anything would help!
    

    And for reference, the questions referred to (I guess) are:

    • How to add items one at a time to to a new line a word document using word interop
    • Using interop.word ranges

    … which all now have been answered 🙂

    You ask multiple questions in this post however – first:

    How do ranges and selections work?

    Actually, the documentation covers this quite well:

    A range:

    “Represents a contiguous area in a document.

    Each Range object is
    defined by a starting and ending character position. Similar to the
    way bookmarks are used in a document, Range objects are used to
    identify specific portions of a document…”

    Reference: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.range(v=office.14).aspx.

    If you insert something at the top of the page through a range, is
    that overridden by inserting something with selection?

    It can be. This depends on what has been selected. If you select something that intersects with the range of the content you just inserted and changes the content, then you will make changes to the content of the range.

    To understand this completely, I will recommend that you read about:

    • The Selection Interface
    • The Range Interface

    Does selection affect ranges?

    It depends. The documentation states:

    Range objects are independent of the selection.

    Reference: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.range(v=office.14).aspx

    … so if you just do a simple selection in order to, e.g., read content or copy content to
    the clipboard, nothing would change. However, if you use the selection to change content, of course this would affect the content pointed to by the ranges. In continuation of this you should note that MS recommends using Range objects for document manipulation:

    Because Range objects share many of the same methods and properties as
    Selection objects, using Range objects is preferable for manipulating
    a document when there isn’t a reason to physically change the current
    selection.

    Reference: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.selection.aspx

    And finally, you ask:

    I’m having a problem where I do inserts in this order, but the
    InlineShapes show up at the top of the document above the
    Range.Inserts. Also, the Selection.InsertBefore gets replaced by the
    InlineShapes.

    I would like my range insert to appear above each picture, like a
    heading. How can this be done?

    See my previous answer to your question: ” How to add items one at a time to to a new line a word document using word interop ” here: https://stackoverflow.com/a/12751805/700926 – that gives you a complete answer.

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

Sidebar

Related Questions

Is it possible to use or adapt jQuery's .select() to set a selection range
I have locked cells in a spreadsheet using this lines of code. Range(A1:D23).Select Selection.Locked
Does a jQuery only solution exist for selecting a range of rows from a
Does Boost Ranges have a built-in way to cout the elements easily, for example
Any phone numbers that begin with these ranges correct: ex: 772123322 The length is
Is it possible for jQuery to work with partial elements (aka ranges)? Probably not,
I would like to specify that firefox select a range. I can do this
I have been trying to work out how to insert text before and after
ActiveSheet.Pictures.Insert doesnt work with remote images in Excel 2007... anyone got an alternative method?
I'm having trouble figuring out how to work with word ranges. I have picture

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.