40 lines
935 B
Markdown
40 lines
935 B
Markdown
---
|
|
title: powerpoint VBA - copy comments
|
|
updated: 2022-06-14 13:38:24Z
|
|
created: 2022-06-14 13:37:55Z
|
|
latitude: 40.75891113
|
|
longitude: -73.97901917
|
|
altitude: 0.0000
|
|
---
|
|
|
|
```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
|
|
``` |