There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus batch bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop lcd malware memory modem monitor motherboard network printer problem ram registry router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Show/Hide Picture

Reply  
Thread Tools
look_b4u_leap's Avatar
Computer Specs
Member with 58 posts.
 
Join Date: Jan 2009
Location: Ottawa, Canada
Experience: Intermediate
30-Jun-2009, 11: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 online now
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
30-Jun-2009, 11:18 AM #2
What program are you using?
look_b4u_leap's Avatar
Computer Specs
Member with 58 posts.
 
Join Date: Jan 2009
Location: Ottawa, Canada
Experience: Intermediate
30-Jun-2009, 12:02 PM #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 online now
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
30-Jun-2009, 03: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 58 posts.
 
Join Date: Jan 2009
Location: Ottawa, Canada
Experience: Intermediate
30-Jun-2009, 04: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 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
30-Jun-2009, 06: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!
Reply

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.

Search Tech Support Guy

Find the solution to your
computer problem!




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



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:54 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.