Originally Posted by
John Wilson
So you are opening basically a copy with no name and no window. How does the file dialog know which file to save as?
I create it with the variable newpres using:
Set newpres = Presentations.Open(ActivePresentation.FullName, False, True, False)
Then I make all of the changes using the newpres variable. for example:
newpres.Slides(1).Shapes("TitleBox").TextFrame.TextRange.Text = "Management Monthly Report"
Then I use the following code to prompt the user for the save filename:
Set savename = Application.FileDialog(Type:=msoFileDialogSaveAs)
With savename
.InitialFileName = "New Chart.pptx"
If .Show = -1 Then
strMyFile = .SelectedItems(1)
newpres.SaveAs (strMyFile)
Else
MsgBox "No File Entered. Cancelling.", , "No Filename"
End If
End With
newpres.Close