Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-11-2022, 07:51 PM
macropod's Avatar
macropod macropod is offline Insert Image Reference in Each Deprecated Picture's Place in Multiple Documents Windows 10 Insert Image Reference in Each Deprecated Picture's Place in Multiple Documents Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,371
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your ReferenceMyImages sub only loops through InlineShapes. But you ignore what the loop is doing and use both:
• PicPath = Selection.ShapeRange(1).LinkFormat.SourceFullName (which is invalid for inlineshapes); and


• PicPath = Selection.InlineShapes(1).LinkFormat.SourceFullNam e (which is only valid for images inserted as links),
and both reference Selection, which isn't necessarily related to any image in the document - what might be selected when the macro is run might just be some text.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 07-12-2022, 10:18 AM
zanodor zanodor is offline Insert Image Reference in Each Deprecated Picture's Place in Multiple Documents Windows 10 Insert Image Reference in Each Deprecated Picture's Place in Multiple Documents Office 2016
Novice
Insert Image Reference in Each Deprecated Picture's Place in Multiple Documents
 
Join Date: Jun 2022
Posts: 17
zanodor is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Your ReferenceMyImages sub only loops through InlineShapes. But you ignore what the loop is doing and use both:
• PicPath = Selection.ShapeRange(1).LinkFormat.SourceFullName (which is invalid for inlineshapes); and
• PicPath = Selection.InlineShapes(1).LinkFormat.SourceFullNam e (which is only valid for images inserted as links),
and both reference Selection, which isn't necessarily related to any image in the document - what might be selected when the macro is run might just be some text.
I borrowed those lines from a forum thread as you might have guessed. I had probably used your codes before in my migration project here and there and sometimes everything just worked (changing a bit of code to suit my needs). So this kind of hit or miss business is like this. Like trying to speak a foreign language with no grammar but some words picked up here and there. Although I have to say I am beginning to like VB/VBA. Reminds me of my BASIC days on C64. The last programming language I used was Pascal...

I am now thinking about inserting captions and looking around the net for changing those text parameters into hyperlinks which will be internal relative paths in the program I am going to be using.
I am also looking into how to go about using file and folder names and appending those. But everything is being made more difficult when you try to run macros on 14000 files and all files have different amount of images in them, if any.

I have a feeling I will have to resort to having just some placeholders or reminders to mark the positions of where the images used to be in the document.
Can you help me with that?

So I would need "For Each Image" (position) let's say a highlighted text or a bold green text to bring my attention to where I need to put some elbow grease in it when going through my documents. (With a macro I would change that bold green to something the markdown program will be able to interpret.)

In exchange I could tell you how "macro" and "meagre" are semanto-logically related. Even "Maker" as Creator.

Cheers,

Z.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Insert Image(logo) into header for multiple Word Docs Axis Word VBA 4 02-09-2022 10:34 PM
Insert Image Reference in Each Deprecated Picture's Place in Multiple Documents Changing footer image in Multiple word documents killabyte Word VBA 2 09-23-2020 05:49 AM
How to place an image placeholder that scales the image to the full frame size in a template Cube Word 5 07-05-2020 08:27 AM
Insert Image Reference in Each Deprecated Picture's Place in Multiple Documents Adding Title Image to Multiple Documents. Agog Word VBA 4 05-03-2018 05:30 AM
Insert Image Reference in Each Deprecated Picture's Place in Multiple Documents Replace footer image in multiple Word documents heyjim Drawing and Graphics 1 08-07-2015 05:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft