创建加载项以在Powerpoint(VBA)中添加便签 [英] Create add-in to add sticky notes in powerpoint (VBA)
问题描述
我想为PowerPoint创建一个简单的宏,该宏使我可以单击一个按钮以在幻灯片上自动插入黄色便笺,以便我可以插入注释.这是我当前工作中需要做的一遍又一遍的事情,现在我浪费了很多时间,每次创建一个矩形->将其着色为黄色->创建黑色轮廓->将字体颜色设置为红色和大小到12 ..
I would like to create a simple macro for powerpoint that would allow me to click on one button to automatically insert a yellow sticky note onto my slide so I can insert a comment. This is something I need to do over and over in my current job and right now I am wasting a lot of time, each time creating a rectangle -> coloring it yellow -> creating a black outline -> setting font color to red and size to 12..
感谢这里的任何帮助,我知道应该不会很困难!
Appreciate any help here, I know it should not be very hard!
谢谢!
推荐答案
我为您写了这篇文章,希望对您有所帮助.
I wrote this for you and hope it helps.
Sub insert_sticky_note()
Dim mySlide As PowerPoint.Slide
Dim myTextbox As PowerPoint.Shape
Set mySlide = ActivePresentation.Slides(ActiveWindow.View.Slide.SlideNumber)
Set myTextbox = mySlide.Shapes.AddTextbox(msoTextOrientationHorizontal, _
Left:=0, Top:=10, Width:=200, Height:=50)
myTextbox.Fill.BackColor.RGB = RGB(250, 246, 0) 'yellow
myTextbox.Fill.Transparency = 0.2 'translucent
myTextbox.Height = 150
myTextbox.Width = 300
myTextbox.TextFrame2.AutoSize = msoAutoSizeTextToFitShape 'https://www.pcreview.co.uk/threads/how-to-vba-code-shrink-text-on-overflow.3537036/#post-12183384
With myTextbox.TextFrame.TextRange
.Text = "Note"
'With .Font
' .Size = 12
' .Name = "Arial"
'End With
End With
End Sub
这篇关于创建加载项以在Powerpoint(VBA)中添加便签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!