Shape fill

E

Eric

Seems like it should be a simple question, but I'm finding the answer
frustratingly obscure...
Usin Pub 2007 from vba (or external vb, in fact...) having succeeded in
setting the fill color of a newly created textbox shape to something other
than white... how does one then set the transparency to something other than
0 so underlying items will show through?
It seems I can poke any value between 0 and 1 up what looks like the right
property without error, but it makes no visual difference... is this
(another) bug?
 
E

Ed Bennett

Eric said:
It seems I can poke any value between 0 and 1 up what looks like the right
property without error, but it makes no visual difference... is this
(another) bug?

It would seem so. (Peeking the variable gives the right result, though.)
I'll see if I can escalate this.
 
E

Ed Bennett

Eric said:
It seems I can poke any value between 0 and 1 up what looks like the right
property without error, but it makes no visual difference... is this
(another) bug?

Addendum: Even worse. Setting it to 1 and then reading it back gives
1.525879E-05, anything else gives 0. If the shape is transparent prior
to setting it, it seems to remain transparent, until it is modified in
the UI, at which point it jumps to being opaque.

I suggest avoiding writing to this property for the time being.
 
E

Eric

Thanks for the corroboration Ed - that's exactly what I've seen too.
It's good to know it wasn't just me missing something.

There seems to be quite a long list of Publisher bugs - and it seems to get
longer with every new release. Is there any real intent within MS to fix any
of them?

I'd also throw in:
No overflow status is ever set on text boxes containing only one line
Inaccuracy in vba text height/width function call return values (rounding
errors?)
(manifested when trying to make a text box exactly fit text within - numbers
returned usually, but not always, result in a box which is too small)

These are just a couple which have caused me particular irritation in the
past.
 
M

Miguel Gonzalez

The trasnparency property from the ForeColor doesn't fully work as you
discovered. The way you change the transparency is through a property that
for some reason is hidden:
To apply a forecolor in VBA and change the transpareny you can do something
like:
myTextbox.Fill.ForeColor.RGB = RGB(5, 247, 130)
myTextbox.Fill.Transparency = 0.5

*Transparency will not autocomplete or show in intellisense since its a
hidden property

This should change the shape transparency as expected.

Hope this helps,
Miguel
 
E

Eric

Thanks for that Miguel, very helpful.


Miguel Gonzalez said:
The trasnparency property from the ForeColor doesn't fully work as you
discovered. The way you change the transparency is through a property that
for some reason is hidden:
To apply a forecolor in VBA and change the transpareny you can do
something
like:
myTextbox.Fill.ForeColor.RGB = RGB(5, 247, 130)
myTextbox.Fill.Transparency = 0.5

*Transparency will not autocomplete or show in intellisense since its a
hidden property

This should change the shape transparency as expected.

Hope this helps,
Miguel
 

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