文本框背景色不消失
The text box background color doesn't disappear
Set shp = aslide.Shapes.AddShape(Type:=msoShapeRectangle, Left:=50, Top:=185, Width:=600, Height:=26.6)
shp.Line.Visible = msoFalse
shp.TextFrame.TextRange.Font.Color.RGB = RGB(10, 47, 93)
shp.TextFrame.TextRange.Characters.Text = "HI"
shp.TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignLeft
shp.TextFrame2.VerticalAnchor = msoAnchorMiddle
shp.TextFrame2.TextRange.Font.Size = 28
shp.TextFrame2.TextRange.Font.Name = "Arial"
我的幻灯片默认布局是浅蓝色的,但是当我添加这个文本框时,我希望文本颜色是深蓝色,它是深蓝色,我可以看到文本,但是背景即使我没有使用填充功能,文本框的 也不会消失。如何解决这个问题,看起来真的很糟糕。提前致谢。
我认为这应该可以解决问题:
shp.Fill.Transparency = 0
shp.Fill.ForeColor.RGB = RGB(0, 0, 0)
shp.Fill.BackColor.RGB = RGB(0, 0, 0)
将形状的背景颜色和前景色设置为黑色,只需将此颜色切换为与 RGB 中的背景颜色相匹配即可。
或者,我刚刚测试了将透明度设置为完全即:
shp.Fill.Transparency = 1
这是可行的,因为它会忽略默认设置的任何颜色。
Set shp = aslide.Shapes.AddShape(Type:=msoShapeRectangle, Left:=50, Top:=185, Width:=600, Height:=26.6)
shp.Line.Visible = msoFalse
shp.TextFrame.TextRange.Font.Color.RGB = RGB(10, 47, 93)
shp.TextFrame.TextRange.Characters.Text = "HI"
shp.TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignLeft
shp.TextFrame2.VerticalAnchor = msoAnchorMiddle
shp.TextFrame2.TextRange.Font.Size = 28
shp.TextFrame2.TextRange.Font.Name = "Arial"
我的幻灯片默认布局是浅蓝色的,但是当我添加这个文本框时,我希望文本颜色是深蓝色,它是深蓝色,我可以看到文本,但是背景即使我没有使用填充功能,文本框的 也不会消失。如何解决这个问题,看起来真的很糟糕。提前致谢。
我认为这应该可以解决问题:
shp.Fill.Transparency = 0
shp.Fill.ForeColor.RGB = RGB(0, 0, 0)
shp.Fill.BackColor.RGB = RGB(0, 0, 0)
将形状的背景颜色和前景色设置为黑色,只需将此颜色切换为与 RGB 中的背景颜色相匹配即可。
或者,我刚刚测试了将透明度设置为完全即:
shp.Fill.Transparency = 1
这是可行的,因为它会忽略默认设置的任何颜色。