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

I'll need sometime to digest your code. However I have this so far which appears to work quite well. I'll fully test it today. There are aspects here that I do not understand, mostly about the when and how of declaring and retreiving variables. But I have a result of sorts.

Code:
Sub Main()

Dim i As Long
Dim tgf As String
Dim filenametitle 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
                Options.DefaultFilePath(wdDocumentsPath) = tgf
                filenametitle = ActiveDocument.BuiltInDocumentProperties("Title")
                With Dialogs(wdDialogFileSaveAs)
                .Name = filenametitle
                .Format = wdFormatPDF
                .Execute
                ActiveDocument.Close SaveChanges:=False


    End With


        Next

        Else

        End If

    End With


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

End Sub
Reply With Quote