Skip to content

Instantly share code, notes, and snippets.

@bobbychopra
Created July 12, 2013 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobbychopra/5987465 to your computer and use it in GitHub Desktop.
Save bobbychopra/5987465 to your computer and use it in GitHub Desktop.
Mail Merge for Powerpoint
Sub MailMergeFromFile()
Dim hf As Integer: hf = FreeFile
Dim lines() As String, i As Long
Open "c:\users.txt" For Input As #hf
lines = Split(Input$(LOF(hf), #hf), vbNewLine)
Close #hf
For i = 0 To UBound(lines)
' MsgBox "Line" & i & "=" & lines(i)
ActivePresentation.Slides.Range(1).Copy
Set ss = ActivePresentation.Slides.Paste
ss.Shapes(2).TextFrame.TextRange = lines(i)
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment