Populating PP presentation with a word list

M

McDoughall

I am creating a series of word list drills for typing students, using
powerpoint to present the drills. I have a macro that will take a list of
works from a text file and import them one per slide to the presentation.

I'm using a TitleOnly slide layout but I want to centre the text on the
page, instead of having the line of text at the top of the page.

I tried adding increment commands and even recorded a centering action of
manually centering the text box on the slide but when I run the parent macro,
it does not pick up the centering command.

My Macro is below:


Sub HeadingsAndTextFromFile()

' Purpose:
' Read a plain text file
' And convert it to a presentation with one slide per Heading in the file

Dim sFileName As String
Dim iFileNum As Integer
Dim sText As String
Dim oSl As Slide

If Presentations.Count = 0 Then
MsgBox "Open a presentation then try again"
Exit Sub
End If

' EDIT THIS TO REFLECT THE NAME AND LOCATION
' OF THE TEXT FILE YOU WANT TO USE:
sFileName = "filepathe:/list.txt"

iFileNum = FreeFile()
Open sFileName For Input As iFileNum

' Use the current presentation
With ActivePresentation.SlideMaster _
.TextStyles(ppBodyStyle).Levels(1)
With .Font
.Name = "Arial"
.Size = 80
End With
With .ParagraphFormat
.LineRuleBefore = False
.SpaceBefore = 14
.Alignment = ppAlignCenter
End With
End With

With ActivePresentation
Do While Not EOF(iFileNum)
Line Input #iFileNum, sText
Set oSl = .Slides.Add(.Slides.Count + 1, ppLayoutTitleOnly)
With oSl
.Shapes.Title.TextFrame.TextRange.Text = sText
End With
Loop
End With

Set oSl = Nothing
Close iFileNum

End Sub

I've put the centering Sub in various places but it never centers for me.

Should I be using a different slide layout, say "Title" instead of "Title
Only"?

Any help would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top