37 lines
879 B
Markdown
37 lines
879 B
Markdown
title:: powerpoint VBA - copy comments
|
|
updated:: 2022-06-14 13:38:24+00:00
|
|
created:: 2022-06-14 13:37:55+00:00
|
|
|
|
|
|
```vb
|
|
Sub CopyComments()
|
|
Dim lFromSlide As Long
|
|
Dim lToSlide As Long
|
|
|
|
lFromSlide = InputBox("Copy comments from slide:", "SLIDE")
|
|
lToSlide = InputBox("Copy comments to slide:", "SLIDE")
|
|
|
|
Dim oFromSlide As Slide
|
|
Dim oToSlide As Slide
|
|
|
|
Set oFromSlide = ActivePresentation.Slides(lFromSlide)
|
|
Set oToSlide = ActivePresentation.Slides(lToSlide)
|
|
|
|
Dim oSource As Comment
|
|
Dim oTarget As Comment
|
|
|
|
For Each oSource In oFromSlide.Comments
|
|
|
|
Set oTarget = _
|
|
ActivePresentation.Slides(lToSlide).Comments.Add( _
|
|
oSource.Left, _
|
|
oSource.Top, _
|
|
oSource.Author, _
|
|
oSource.AuthorInitials, _
|
|
oSource.Text)
|
|
|
|
Next oSource
|
|
|
|
End Sub
|
|
```
|