PPT加载宏入门

来源:互联网 发布:excel数据对比错误原因 编辑:程序博客网 时间:2024/05/31 19:29
Sub an()
ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeRoundedRectangle, 100, 200, 100, 60).Select

With ActiveWindow.Selection.ShapeRange
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(0, 128, 0)
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(128, 0, 0)
End With

With ActiveWindow.Selection.TextRange
.Text = InputBox("请输入按键名称", "按键名称", "确定")
    With .Font
    .NameFarEast = "隶书"
    .Size = 36
    .Color.RGB = RGB(Red:=255, Green:=0, Blue:=0)
    End With
End With

ActiveWindow.Selection.Unselect

End Sub