Katie
Katie

Reputation: 308

Save PPT as PNG without "Export" VBA

Is there a way to save a single slide as a PNG image with VBA that does not use Slides(#).Export? I am trying to save the image directly to SharePoint but the export causes an error if I make the save location anywhere besides my machine. I know that saving directly to SharePoint as an image is possible since I can click through the save as menu, but I cant replicate with VBA.

Application.FileDialog(msoFileDialogSaveAs _
    ).InitialFileName = "https://home.thesite.com/sample"
intChoice = Application.FileDialog(msoFileDialogSaveAs).Show
    If intChoice <> 0 Then

        sImagePath = Application.FileDialog(msoFileDialogSaveAs _
        ).SelectedItems(1)

    Else
        MsgBox "Action Cancelled"
        Exit Sub

    End If

 CurSlide = ActiveWindow.Selection.SlideRange.SlideIndex
 ActivePresentation.Slides(CurSlide).Export sImagePath, "PNG"

Upvotes: 0

Views: 345

Answers (1)

Katie
Katie

Reputation: 308

Turns out Export will work if the link is modified so instead of

 "https://home.thesite.com/sample" 

its

 "\\home.thesite.com@SSL\DavWWWRoot\sample"

Upvotes: 1

Related Questions