+ Reply to Thread
Results 1 to 5 of 5

How to identify a particular inlineshape in VBA ?

  1. #1
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    How to identify a particular inlineshape in VBA ?

    I'm trying to come up with a method to programmatically adjust or replace images/charts in Word for mac. My idea is to provide a list of images to be imported, and the name of the target Shape in the document.

    As Shapes have a .name property, it is trival to find a shape object with the correct name, copy it's position and size properties, and insert a new image to the same position.

    However if the image is an INLINEshape, there is no .name property. I don't even see an easy way tell what index an inline shape is unless that index was already known. At this point the ONLY reliable method I can think of is to have the user be prompted to MANUALLY select the appropriate image that next needs to be changed. This is not acceptable as there may be a list of hundreds of images to find and change.

    How can I pass an identifier of some kind to my macro, and ensure that I am referring to the correct inlineshape?

    Thanks in advance for any suggestions.
    If my solution helped, please consider adding Rep

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to identify a particular inlineshape in VBA ?

    Could you not make use of the Bookmark property of the inline shape?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: How to identify a particular inlineshape in VBA ?

    Quote Originally Posted by Andy Pope View Post
    Could you not make use of the Bookmark property of the inline shape?
    InlineShape does not have a bookmark property.

    Do you mean to set a bookmark, and have that range refer to the position of the shape? How would I be able to externally record a reference to a bookmark?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to identify a particular inlineshape in VBA ?

    Yes I mean add a bookmark, which can have a name, to the inlineshape or space just before it.

    You could loop through the inlineshapes collection adding bookmarks.
    Not sure what you mean by 'externally record a reference to a bookmark'

  5. #5
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: How to identify a particular inlineshape in VBA ?

    Well I need to read a list of images, and match them to the target images that will be replaces. I think that saving the name of the book mark will work, so I'll consider this solved.
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Identify max value or min value in a row
    By Parth007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2016, 04:46 AM
  2. Word VBA select Shape(1) and InlineShape(1) HELP
    By marylin123 in forum Word Formatting & General
    Replies: 5
    Last Post: 04-08-2016, 01:34 AM
  3. Delete all Paragraph in a Word document containing a particular inlineshape using VBA
    By sshishirkumar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2015, 05:28 AM
  4. column comparison, trying to identify identify identical columns.
    By Jowel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2014, 04:12 AM
  5. Can someone help me identify what this is?
    By Murellus in forum Excel General
    Replies: 1
    Last Post: 06-14-2013, 05:36 AM
  6. InlineShape number in a document?
    By mws1985 in forum Word Formatting & General
    Replies: 1
    Last Post: 03-16-2012, 02:17 AM
  7. Identify:Need Help
    By ravi_m5_2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2010, 01:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1