G
Greg Glynn
Powerpoint Mail Merge
If your looking for a way to create Powerpoint slides from a text
(txt) file, I'm developing a macro to do it.
I'm directing a performance of "HMS Pinafore" and want to project the
lyrics of the songs on a screen for the Audience.
Create your Data File using Notepad and save it. Save it and change
the "Lyric =" line in the macro to your file name
The macro creates as many slides as there are lines in the data file.
Sub PPT_MailMerge()
'
' Macro Author: Greg Glynn
'
Dim Lyric As Variant
Lyric = "H:\HMS Pinafore\HMS Pinafore - Sober Men.txt"
Open Lyric For Input As #1
Do While Not EOF(1)
Frame = Frame + 1
ActivePresentation.Slides.Add(Index:=Frame,
Layout:=ppLayoutText).Select
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 2").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters
(Start:=1, Length:=0).Select
With ActiveWindow.Selection.TextRange
Line Input #1, SlideText
.Text = SlideText
With .Font
.Name = "Franklin Gothic Book"
.Size = 24
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppBackground
End With
End With
ActiveWindow.Selection.ShapeRange.Select
ActiveWindow.Selection.Unselect
Loop
Close #1
End Sub
If your looking for a way to create Powerpoint slides from a text
(txt) file, I'm developing a macro to do it.
I'm directing a performance of "HMS Pinafore" and want to project the
lyrics of the songs on a screen for the Audience.
Create your Data File using Notepad and save it. Save it and change
the "Lyric =" line in the macro to your file name
The macro creates as many slides as there are lines in the data file.
Sub PPT_MailMerge()
'
' Macro Author: Greg Glynn
'
Dim Lyric As Variant
Lyric = "H:\HMS Pinafore\HMS Pinafore - Sober Men.txt"
Open Lyric For Input As #1
Do While Not EOF(1)
Frame = Frame + 1
ActivePresentation.Slides.Add(Index:=Frame,
Layout:=ppLayoutText).Select
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 2").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters
(Start:=1, Length:=0).Select
With ActiveWindow.Selection.TextRange
Line Input #1, SlideText
.Text = SlideText
With .Font
.Name = "Franklin Gothic Book"
.Size = 24
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppBackground
End With
End With
ActiveWindow.Selection.ShapeRange.Select
ActiveWindow.Selection.Unselect
Loop
Close #1
End Sub