使用 VBA 向 Powerpoint 演示文稿添加注释

问题描述 投票:0回答:2

我想使用 VBA 在 Powerpoint 演示文稿中添加注释。我有使用 For 循环的代码,但是当我运行宏时,注释将添加到整个演示文稿,即 PPT 中的所有幻灯片。我想将评论添加到选定的幻灯片中。有人可以帮忙吗?
这是使用 For 循环添加一些注释的代码:

Sub FictiousNames()
  Dim mySlides As Slide
  Dim cmtNew As Comment

  For Each mySlides In ActivePresentation.Slides
  Set cmtNew = mySlides.Comments.Add(Left:=12, Top:=12, _
    Author:="Fictious Names", AuthorInitials:="", _
    Text:="Please verify if this is an approved fictitious name. Also, you can use the following link to generate fictitious names: https://microsoft.sharepoint.com/sites/LCAWeb/Home/Copyrights-Trademarks-and-Patents/Trademarks/Fictitious-Names-Finder)"
Next mySlides

End Sub
vba powerpoint
2个回答
2
投票

如果您想向单个(特定)幻灯片添加注释,则不需要使用

For
循环,只需复制以下代码即可:

Sub FictiousNames()

' modify the number in brackets (9) to your slide number
ActivePresentation.Slides(9).Comments.Add 12, 12, "Fictious Names", "", _
    "Please verify if this is an approved fictitious name. Also, you can use the following link to generate fictitious names: https://microsoft.sharepoint.com/sites/LCAWeb/Home/Copyrights-Trademarks-and-Patents/Trademarks/Fictitious-Names-Finder)"

End Sub

-1
投票

如何将该评论粘贴到文本框

© www.soinside.com 2019 - 2024. All rights reserved.