I hope you can help me out.
I'm new to development and develop in MS Access.
I have come across some work which i'm abit lost with.
I am trying to get 3 textboxes and a picture to be placed in MS PowerPoint so it can run a slide show but it needs to come from MS Access
My controls on my form are
txtTitle
txtRefNumber
txtAboutMe
imgPicture
I got txtTitle and txtRefNumber in the same line (I got that to work with my MS PowerPoint).
I am trying to get the layout to be
txtTitle and txtRefNumber
imgPicture
txtAboutMe
Okay so far this is what I have :
Code: Select all
Dim objPresentation As PowerPoint.Presentation
Dim objSlide As PowerPoint.Slide
Dim strFileName As String
'Ensure that both the title and the picture are selected
If IsNull(Me.txtTitle) Or IsNull(Me.txtRefNumber) Or Me.imgPicture.Name = "" Then
MsgBox "A Title And A Reference Number Must Be Entered , and a Picture Selected Before Proceeding", vbRetryCancel, "Make PowerPoint Slides"
Else
'Create instance of PowerPoint application
Set mobjPPT = New PowerPoint.Application
'Make instance visible to user
mobjPPT.Visible = True
'Add a Presentation
Set objPresentation = mobjPPT.Presentations.Add
'Add a Slide
Set objSlide = objPresentation.Slides.Add(1, ppLayoutClipartAndText)
'Change the Slide Background
objSlide.Background.Fill.ForeColor.RGB = RGB(189, 130, 255)
'Modify the Slide Title
With objSlide.Shapes.Title.TextFrame.TextRange
.Text = (Me.txtTitle) & "-" & Me.txtRefNumber & " " & Me.txtAboutMe
.Font.Size = 74
.Font.Color.RGB = RGB(255, 100, 255)
.Font.Italic = True
.Font.Bold = msoTrue
End With
'Add the picture to the slide
strFileName = imgPicture.Picture
objSlide.Shapes.AddPicture FileName:=strFileName, _
Left:=1000, Top:=2550, _
LinkToFile:=msoFalse, SaveWithDocument:=msoTrue
End If
cmdMakePPTSlide_Exit:
Set objPresentation = Nothing
Set objSlide = Nothing
Exit Sub
cmdMakePPTSlide_Err:
MsgBox "Error # " & Err.Number & ": " & Err.Description
Resume cmdMakePPTSlide_Exit
End Sub
Hope you can help