Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vba 按宏向PowerPoint添加注释_Vba_Comments_Powerpoint_Add - Fatal编程技术网

Vba 按宏向PowerPoint添加注释

Vba 按宏向PowerPoint添加注释,vba,comments,powerpoint,add,Vba,Comments,Powerpoint,Add,我对Excel宏有很好的理解,但现在我想在PowerPoint中创建一些东西。不幸的是,在PowerPoint 2013中没有“录制宏”选项,因此我可以录制并调整初始步骤。因此,请允许我问两个具体问题如何解决: 1.向当前幻灯片添加注释 2.将新创建的注释相对于其当前位置上移一点 感谢您提前提供的任何提示。 亲切问候,, Balázs这将添加注释,并允许您提供作者姓名、首字母缩写和职位。首字母部分起作用,名字部分似乎不起作用。我想PPT总是会选择当前的用户名 Sub Test() Add

我对Excel宏有很好的理解,但现在我想在PowerPoint中创建一些东西。不幸的是,在PowerPoint 2013中没有“录制宏”选项,因此我可以录制并调整初始步骤。因此,请允许我问两个具体问题如何解决: 1.向当前幻灯片添加注释 2.将新创建的注释相对于其当前位置上移一点 感谢您提前提供的任何提示。 亲切问候,,
Balázs

这将添加注释,并允许您提供作者姓名、首字母缩写和职位。首字母部分起作用,名字部分似乎不起作用。我想PPT总是会选择当前的用户名

Sub Test()
    AddComment ActivePresentation.Slides(1), "This is the comment", "Abraham Lincoln", "AL"
End Sub

Sub AddComment(oSl As Slide, sText As String, _
    Optional sAuthor As String = "", _
    Optional sAuthorInitials As String = "XX", _
    Optional sngTop As Single = 100, Optional sngLeft As Single = 100)

    With oSl
        .Comments.Add sngLeft, sngTop, sAuthor, sAuthorInitials, sText
    End With

End Sub