Creative graphics

D

Doc

Good Evening Y'all,

My problem is trivial. I am submitting it with the hope of learning some
coding techniques.

I have a WordArt object on a worksheet. When the object is made visible,
its transparency is 0%. I keep it in view for 10 seconds and then would
like the background to appear to fade away with the text unchanged. The
problem is that the fading is not smooth. Each transparency change,
regardless of how much (in my case 10%), remains visible for approximately 1
second before changing again until the transparency is at 100% when I hide
the object.

Is there any way of changing my code to make the transparency changes smooth
? I suspect the 1 second delay is the time Excel requires to refresh the
WordArt object on the display. While on the subject, what is the code, if
any, to fade the text only and leave the background unchanged ? I could
only find code to change the font name, size, bold or italics.

The macro recorder did not even recognize selecting the WordArt object.
Google and Bing helped with the background transparency but not the text
transparency.

Here is my code snippet:

Dim ViewReminder As Shape
Dim Start As Double, Dimmer As Double
Set ViewReminder = ActiveSheet.Shapes("ScreenMessageBox")
With ViewReminder
.Fill.Transparency = 0
.Visible = True
End With
Start = Timer
Do While Timer < Start + 10
DoEvents
Loop
' Begin fade
For Dimmer = 0 To 1 Step 0.1
ViewReminder.Fill.Transparency = Dimmer ' <--- Each change is visible
'
for about 1 second
DoEvents
Next Dimmer
With ViewReminder
.Visible = False
.Fill.Transparency = 0
End With

Thank you to all interested.

Doc
 
B

Barb Reinhardt

You can do something like this on the shape


myshape.TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)

For i = 0 To 200 Step 5 'Can go to 255
Debug.Print i
myshape.TextFrame.TextRange.Font.Color.RGB = RGB(i, i, i)
Next i
 
D

Doc

Barb,

Thank you for the immediate reply.
The line
myshape.TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
caused an error 438: Object doesn't support this Property or Method.
Your suggestion caused me to relook at the font transparency issue.
Why I found it now and not yesterday is ..... sleep deprivation, that's it.

The font transparency code is
myshape.TextFrame2.TextRange.Font.Fill.Transparency = 0.8 ' 0 to 1

When placed in my code, the font transparency change is the same as the
background.
It takes about 1 second for each change.

I got your routine to work. It will change the color of the text from black
to white but not the transparency. Interestingly, the font color change
(like you suggested) is smooth. I did need to add a 'DoEvents after setting
the RGB color.

This is what I have found:
myshape.Fill.Transparency = # (# is 0 to 1) ' Changes background
transparency
myshape.TextFrame2.TextRange.Font.Fill.Transparency = # (# is 0 to 1) '
Changes font transparency
myshape.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(#, #, #) ' (#
is 0 to 255) Changes font color

I appreciate your suggestion. It has lead to determining the code to change
the font transparency. My desire to make the transparency changes smooth is
purely for aesthetics. I'm sure I will go on to live another day if I don't
solve it.

Thanks again.

Doc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top