View Single Post
 
Old 07-14-2014, 11:11 PM
smndnm smndnm is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Jul 2014
Location: Queensland
Posts: 24
smndnm is on a distinguished road
Default

Thanks Paul,

I've been working (cutting & pasting from the interweb) on this all afternoon. This is what I have: (looks just like yours)

Code:
Sub Main()

Dim i As Long
Dim tgf As String
With Application.FileDialog(msoFileDialogFolderPicker)
    .AllowMultiSelect = False
    .Title = "Select Folder for..."
    .Show
    tgf = .SelectedItems(1)
End With

MsgBox tgf

 
    Dim vrtSelectedItem As Variant


    With Application.FileDialog(msoFileDialogFilePicker)
        .AllowMultiSelect = True
        If .Show = -1 Then

          
            For Each vrtSelectedItem In .SelectedItems

                Documents.Open FileName:=vrtSelectedItem
                With Dialogs(wdDialogFileSaveAs)
                .Format = wdFormatPDF
                Options.DefaultFilePath(wdDocumentsPath) = tgf
                .Show
                ActiveDocument.Close


    End With


        Next

        Else

        End If

    End With


Shell "C:\program files (x86)\adobe\acrobat 11.0\acrobat\acrobat.exe", vbNormalFocus

End Sub
And it mostly works... mostly
It doesn't keep the folder path as initially selected. I can see I've reused the .SelectedItems, but I have no clue how to manage this. I would like some advice on this.

I need to work out how to SaveAs silently unless the file already exists, but I'll keeping digging and start a new thread when I give up in frustration.

Regards from an overcast and slightly rainy Queensland (the locals are running around crying "the sky is falling, the sky is falling...)
Reply With Quote