Database updates are currently taking place!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Business Applications
Tag Cloud
acer audio bios boot bsod compaq computer connection crash dell display driver drivers dvd error firefox format freeze game hard drive hardware hijackthis install internet laptop linksys macro malware network outlook outlook 2003 outlook 2007 problem realtek redirect router server slow trojan usb video virus vista vpn windows windows 7 windows vista windows xp wireless youtube
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Show/Hide Picture

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
look_b4u_leap's Avatar
Computer Specs
Member with 56 posts.
 
Join Date: Jan 2009
Location: Ottawa, Canada
Experience: Intermediate
30-Jun-2009, 09:11 AM #1
Show/Hide Picture
Hi: I'm looking for a macro (preferably just one I record, not vba) that will show a picture (a jpeg image) in my document when I run it. When I run a second macro, it will hide the picture. How can I do this? I tried to record a macro that does this, but I can't select the object when I'm in the record mode. Heeeeeeeelp! Thanks
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,929 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
30-Jun-2009, 09:18 AM #2
What program are you using?
look_b4u_leap's Avatar
Computer Specs
Member with 56 posts.
 
Join Date: Jan 2009
Location: Ottawa, Canada
Experience: Intermediate
30-Jun-2009, 10:02 AM #3
I'm a doofus! I stuck it in the tags but neglected to mention it in my post, haha.

Word 2007
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,929 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
30-Jun-2009, 01:31 PM #4
Well I don't know about Word, but in Access and Excel you can use an Image and set it to nothing by setting it's source to "". Or you can just set it to Visible = No in Access.
look_b4u_leap's Avatar
Computer Specs
Member with 56 posts.
 
Join Date: Jan 2009
Location: Ottawa, Canada
Experience: Intermediate
30-Jun-2009, 02:39 PM #5
I know how to do it in those other programs, too...I need it in Word
slurpee55's Avatar
Computer Specs
Distinguished Member with 6,832 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
30-Jun-2009, 04:22 PM #6
Well, one idea would be to insert an auto-shape rectangle over your picture that is 0% transparent, change the border to no border, and then convert it to 100% transparent, as I did with the following macro:
Code:
Sub Macro2()
'
' Macro2 Macro
'
    ActiveDocument.Shapes("Rectangle 2").Select
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
    Selection.ShapeRange.Fill.Transparency = 1#
    Selection.ShapeRange.Line.Weight = 0.75
    Selection.ShapeRange.Line.DashStyle = msoLineSolid
    Selection.ShapeRange.Line.Style = msoLineSingle
    Selection.ShapeRange.Line.Transparency = 0#
    Selection.ShapeRange.Line.Visible = msoFalse
    Selection.ShapeRange.LockAspectRatio = msoFalse
    Selection.ShapeRange.Rotation = 0#
    Selection.ShapeRange.Left = 6.45
    Selection.ShapeRange.Top = 10.05
    Selection.ShapeRange.RelativeHorizontalPosition = _
        wdRelativeHorizontalPositionColumn
    Selection.ShapeRange.RelativeVerticalPosition = _
        wdRelativeVerticalPositionParagraph
    Selection.ShapeRange.Left = InchesToPoints(-0.01)
    Selection.ShapeRange.Top = InchesToPoints(-0.02)
    Selection.ShapeRange.LockAnchor = False
    Selection.ShapeRange.LayoutInCell = True
    Selection.ShapeRange.WrapFormat.AllowOverlap = True
    Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
    Selection.ShapeRange.WrapFormat.DistanceTop = InchesToPoints(0)
    Selection.ShapeRange.WrapFormat.DistanceBottom = InchesToPoints(0)
    Selection.ShapeRange.WrapFormat.DistanceLeft = InchesToPoints(0.13)
    Selection.ShapeRange.WrapFormat.DistanceRight = InchesToPoints(0.13)
    Selection.ShapeRange.WrapFormat.Type = 3
    Selection.ShapeRange.ZOrder 4
End Sub
However, please note that the sizes and location are just for the picture I was using - you would have to build your own macro.

Oh, and I used Word 2003, but the idea should still be the same.
__________________
Iowa? I could have sworn this was heaven.
Well, I think I can answer this question most successfully in mime.
My theme song... | Affero - rate me!
Closed Thread Bookmark and Share   techguy.org/839368

Tags
macro, word

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 12:46 PM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by Cermak Technologies, Inc.