PowerPoint/Word 2000 automation

T

Tommie

What I am trying to do through PP is activate Word and
display the Word fileopen dialog box, have the user
select a document, open the Word document, then switch to
PowerPoint and display the fileopen dialog box, have the
user select the presentation, and then have the PP
presentation open. The Word document opens successfully,
and the switch to PP appears successful with the FileOpen
dialog box displaying for the user to select the
presentation. But when I select the presentation from the
dialog box, the presentation does not open, and I get no
errors. If I paste this code in a module by itself, the
presentation will open. BTW, the code is in Powerpoint.
The code for the PP part of it is a follows:


Public WordApp As Word.Application
Public ppApp As PowerPoint.Application
Public ppPres As PowerPoint.Presentation

Public Sub GetPptFile()


'Activate PowerPoint and navigate to presentation to
update.

WordApp.WindowState = 2
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Set ppApp = GetObject(, "PowerPoint.Application")

ppApp.Visible = True
'ppApp.SetFocus


With ppApp.FileDialog(ppFileDialogOpen)

' Set file filter flags
Call .Extensions.Add("*.PPT", "PowerPoint
Presentation")
Call .Extensions.Add("*.PPS", "PowerPoint Show")

.ActionButtonName = "Open"
.DefaultDirectoryRegKey = "Default"
.DialogTitle = "Open"
.DirectoriesOnly = False
.InitialView = ppFileDialogViewPreview
.IsMultiSelect = False
.IsPrintEnabled = False
.IsReadOnlyEnabled = True
.OnAction = "ProcessSelection"
.UseODMADlgs = False

.Launch
End With


End Sub

Public Sub ProcessSelection(ByVal oDlg As FileDialog)

If oDlg.Files.Count = 0 Then Exit Sub
Presentations.Open oDlg.Files(1)

End Sub
 

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