Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-13-2017, 01:07 PM
nsv nsv is offline Rename a VBA imported picture Windows 8 Rename a VBA imported picture Office 2013
Novice
Rename a VBA imported picture
 
Join Date: Jul 2010
Location: Denmark
Posts: 17
nsv is on a distinguished road
Default

Thanks Paul, I will certainly give a try.


This Word VBA appears to be somehow less powerful than VBA for Excel, but that is probably because I am new to it.

NSV
Reply With Quote
  #2  
Old 12-14-2017, 07:28 AM
nsv nsv is offline Rename a VBA imported picture Windows 8 Rename a VBA imported picture Office 2013
Novice
Rename a VBA imported picture
 
Join Date: Jul 2010
Location: Denmark
Posts: 17
nsv is on a distinguished road
Default

OK Paul, that worked so that even I could understand it! - thanks again!
Reply With Quote
  #3  
Old 09-26-2019, 08:21 PM
msdiniz msdiniz is offline Rename a VBA imported picture Windows 10 Rename a VBA imported picture Office 2016
Novice
 
Join Date: Apr 2016
Location: Rio de Janeiro, Brazil
Posts: 3
msdiniz is on a distinguished road
Default No space allowed in Shape name

Hi, all.
Thanks, Paul, it functions.

But, I think there is a catch, at least on Office(Word) 365 USA and Brazil versions:

Shape gets a name Picture # (Picture 1, Picture 2, etc); if you try to add a "Tag", like
Code:
shpPicture.Name = shpPicture.Name & "_" & Format(Now(), "yyyymmdd") & imageTag
it will not work because of the space in Picture 1...
You have to remove the space, like:
Code:
shpPicture.Name = VBA.Replace(shpPicture.Name & "_" & Format(Now(), "yyyymmdd") & imageTag, " ", "")
PS 1: the Date and imageTag? To know what they are and safe delete or move in another occasion.
PS 2: Amazing thing, the index Array at the end, with no need of intermediate variables, thanks for teach it.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename a VBA imported picture Picture content control -> insert picture -> empty? Jaymond Flurrie Word 3 07-13-2016 07:00 AM
Rename a VBA imported picture Convert an imported chart (picture) to an editable drawing object fishguy Drawing and Graphics 1 05-23-2016 02:23 AM
Rename Files gsrikanth Excel Programming 3 05-14-2012 03:03 AM
Move Picture by picture name, rename picture by picture name CatMan PowerPoint 2 04-18-2012 12:21 PM
Powerpoint automatically changing picture size when adding a picture (2010) One_Life PowerPoint 7 01-20-2012 06:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:47 PM.


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