Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2016, 11:28 PM
alexeinahai alexeinahai is offline Hiding and displaying images code Windows 8 Hiding and displaying images code Office 2013
Novice
Hiding and displaying images code
 
Join Date: Sep 2016
Posts: 4
alexeinahai is on a distinguished road
Exclamation Hiding and displaying images code

Good day! I encountered such a problem: there is a file and it is necessary to make a pair of manipulation with the help of macros. I did everything similar to the EXCEL file, but does not want to work work with pictures. there is a picture on the sheet, it is necessary to immediately hide, create PDF, and then back display. PDF I created, but with the problems of the picture. I am doing so:



ActiveDocument.Shapes.Range(Array("Picture 1")).Visible = False

writes the object is not found, try to replace the name of the Picture 1 pictures, did not help ... please tell me what am I doing wrong) :
Reply With Quote
  #2  
Old 09-29-2016, 01:19 AM
macropod's Avatar
macropod macropod is online now Hiding and displaying images code Windows 7 64bit Hiding and displaying images code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,352
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Is 'Picture 1' the name of the picture? If so, you should be able to use:
ActiveDocument.Shapes("Picture 1").Visible = False
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 09-29-2016, 05:13 AM
alexeinahai alexeinahai is offline Hiding and displaying images code Windows 8 Hiding and displaying images code Office 2013
Novice
Hiding and displaying images code
 
Join Date: Sep 2016
Posts: 4
alexeinahai is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Is 'Picture 1' the name of the picture? If so, you should be able to use:
ActiveDocument.Shapes("Picture 1").Visible = False

did as you said, still he says that is not found object with this name. Run-time error '-2147024809'.
Reply With Quote
  #4  
Old 09-29-2016, 05:16 AM
macropod's Avatar
macropod macropod is online now Hiding and displaying images code Windows 7 64bit Hiding and displaying images code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,352
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

All that means is that the picture's name isn't 'Picture 1', it isn't in the document body, or that it's an InlineShape object - not a Shape object.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 09-29-2016, 05:19 AM
alexeinahai alexeinahai is offline Hiding and displaying images code Windows 8 Hiding and displaying images code Office 2013
Novice
Hiding and displaying images code
 
Join Date: Sep 2016
Posts: 4
alexeinahai is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
All that means is that the picture's name isn't 'Picture 1', it isn't in the document body, or that it's an InlineShape object - not a Shape object.
but as I can see the image name?
Reply With Quote
  #6  
Old 09-29-2016, 05:22 AM
macropod's Avatar
macropod macropod is online now Hiding and displaying images code Windows 7 64bit Hiding and displaying images code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,352
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

See it where?
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #7  
Old 09-29-2016, 05:30 AM
alexeinahai alexeinahai is offline Hiding and displaying images code Windows 8 Hiding and displaying images code Office 2013
Novice
Hiding and displaying images code
 
Join Date: Sep 2016
Posts: 4
alexeinahai is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
See it where?

Well, how do you know the file name? excel in clear, there is a column where it is written the name of the file to be added, and in the Word anything similar did not find ...
Reply With Quote
  #8  
Old 09-29-2016, 05:36 AM
macropod's Avatar
macropod macropod is online now Hiding and displaying images code Windows 7 64bit Hiding and displaying images code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,352
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

What does any of this have to do with a filename? Your code concerns a Shape name in a Word document - a name that has nothing to do with a filename. InlineShape objects, on the other hand, don't even have names...
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Powerpoint ImageList/ImageCombo not displaying images joeldodenhoff PowerPoint 0 10-24-2014 10:44 AM
Why is the TOC displaying as a code? ponomariov Word 1 09-28-2012 03:13 PM
Code Error - Hiding comments and revisions silvrwoman Word VBA 6 03-24-2012 10:15 PM
hiding images in word document gib65 Drawing and Graphics 3 08-17-2011 11:09 AM
Hiding and displaying images code Embedding images to email without displaying as attachments in inbox? VMHATUP Outlook 1 06-22-2011 05:39 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 01:05 AM.


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