View Single Post
 
Old 10-21-2022, 02:59 AM
WordUser789 WordUser789 is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2017
Posts: 25
WordUser789 is on a distinguished road
Default

Wow, that is super interesting. Thanks for taking the time to reply.

I am guessing that the expected output of that macro would be that it logs each image from the start of the document to the end? For extra clarity I gave all my images alt text describing which one it was, and also added in a line to delete each one as it went for more visual effect. I then stepped through it bit by bit and watched it and wow, no logic at all to it.

1 1 5 Section 5 RH
1 1 6 Section 6 First Page BG
1 1 2 Section 2 BG
1 1 5 Section 5 LH
1 1 6 Section 6 LH
1 2 3 Section 3 RH
1 2 1 Section 1 BG
1 3 6 Section 6 RH
2 1 3 Section 3 LH

I ran it again and the order was the same so it's obviously not random, but thought perhaps it simply runs through them in the order in which they were inserted? With that in mind I made a new document and pasted each graphic in order. Ran it and got this:

1 1 4 Section 3 RH
1 1 6 Section 6 FP BG
1 1 1 Section 1 BG
1 1 4 Section 3 LH
1 1 6 Section 6 LH
1 2 5 Section 5 RH
1 2 2 Section 2 BG
1 3 6 Section 6 RH
2 1 5 Section 5 LH

So, still not in any particular order. It's almost but not quite the reverse order to before, but as it's not exact I won't read much into it.

Anyway, I went back and took out the delete line, and noticed that it ran 6 times through the document. I was puzzled by this but then saw, aha, I have 6 sections. Added another section and it ran through the loop 7 times. So that would indicate that it does indeed see every image as being part of every section, and it loops through them each time. When I had the line in there to delete the image after it printed the info it obviously only found the info once.

Also, the first number is the section number, and it's seeing all bar one in section 1 as opposed to 1-2 per section as is the reality.

Thanks also for sharing your workaround: sounds like that might solve the problem by approaching it from a different angle.
Reply With Quote