Trouble building PPT presentation from Access Form

mattspoonersurf

New member
Local time
Today, 00:29
Joined
Dec 31, 2012
Messages
3
Hi. I am having a little trouble building a Powerpoint presentation from an Access form.

I open up an exisiting powerpoint presentation, as it is in the correct template. I then take a screenshot of the Access form, then paste it into the next powerpoint slide and rescale the picture to fit the slide. Then I select the next record on the Access form and repeat the process

I have a problem, if Powerpoint application is open, it all works fine, as the focus remains on the Access form. However, if Powerpoint is not open, it opens Powerpoint and the presentation, but since the focus is on powerpoint, it takes a screenshot of powerpoint, not the access form.

Can anyone tell me how to change the screen so that it displays the Access form

Also, I am using office 2003 - when I tried it in 2007 it did not work properly at all


Private Sub Command65_Click()
Dim pwrpnt As Object
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide

Dim objMyChart As Object
Dim shp As String
Dim counter As Integer
Dim myPptShape As PowerPoint.Shape
Dim myScale As Single
Dim iShapesCt As Integer
Dim hdr As String
Dim slide_txt As String
Dim lngCount As Long
Dim ppt As Object
Dim pptfile As String
Dim fd As FileDialog
Dim iRet As Integer
Dim strPrompt As String
Dim strTitle As String
Dim TheAnswer$
Dim OutOfDate As String
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
.Show
pptfile = .SelectedItems(1)
End With

Set ppt = CreateObject("PowerPoint.Application")

With ppt
.Visible = True
.Presentations.Open (pptfile)
End With
Set ppt = Nothing
counter = 1

While counter <= Me.Recordset.RecordCount - 33
Forms![f_200_sop_master_form].SetFocus
Forms![f_200_sop_master_form].Refresh
PrintScreen

DoCmd.GoToRecord Record:=acNext

' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' Reference active slide
Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)

' Paste the chart into Powerpoint
Set PPSlide = PPPres.Slides.Add(counter + 1, ppLayoutTitleOnly)
PPSlide.Shapes.PasteSpecial ppPasteBitmap
PPApp.ActivePresentation.Slides(counter + 1).Select

For Each myPptShape In PPApp.ActiveWindow.Selection.SlideRange.Shapes
If myPptShape.Name Like "Picture*" Then

With myPptShape
.ScaleWidth 0.935, msoTrue, msoScaleFromMiddle
.ScaleHeight 1#, msoTrue, msoScaleFromTopLeft
.IncrementTop 0

End With
End If
Next
counter = counter + 1

Wend
End Sub
 

Users who are viewing this thread

Back
Top Bottom