Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text Box Background Fill Colour Vba

Hi all,

I am trying to use the following Macro to change the Background Colour of a Text Box. Can anyone suggest why it isn't working?

Sub fill

ActiveDocument.GetSheetObject("TX09").Select

Selection.Interior.Fill.Color = RGB(200,160,35)

End Sub

Help much appreciated!

Mbgm4mw3

1 Solution

Accepted Solutions
Not applicable
Author

hi,

you can use the following macro

sub fill

set mybox=activedocument.getsheetobject("TX01")

mbp= mybox.getproperties

mbp.layout.bkgcolor.primarycol.col=rgb(200,160,35)

mybox.setproperties mbp

end sub



thanks

View solution in original post

3 Replies
d_pranskus
Partner - Creator III
Partner - Creator III

Hi

It could be because there is no such VBA function RGB.

Try this instead ActiveDocument.EVALUATE("RGB(10, 20, 30)")

Cheers

Darius

Not applicable
Author

hi,

you can use the following macro

sub fill

set mybox=activedocument.getsheetobject("TX01")

mbp= mybox.getproperties

mbp.layout.bkgcolor.primarycol.col=rgb(200,160,35)

mybox.setproperties mbp

end sub



thanks

Not applicable
Author

Thanks Tauqueer that's absolutely brilliant!

Do you know the QV syntax if I want to change the fill color of a shape placed in a text box as an "image" rather than changing bkgcolor?

Mbgm4mw3