1

I want to add comments to a powerpoint presentation using VBA. I have this code using For loop but when I run the macro, the comment is adding to the whole presentation, i.e., all slides in the PPT. I wanted to add the comment to a selected slide. Can anyone help?
This is the code using For loop to add some comment:

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
0

1 Answer 1

2

If you want to add a comment to a single (certain) slide, you don't need to use the For loop, just copy the code below:

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.