View Single Post
 
Old 12-25-2017, 12:48 PM
Testpilot.dk Testpilot.dk is offline Windows 10 Office 2016
Novice
 
Join Date: Dec 2017
Posts: 2
Testpilot.dk is on a distinguished road
Default Let's focus on the issue

Hi,

Let us focus on my real issue and not my variables and so on.

If we focus on this piece of code.
Code:
Public WithEvents oApp As Word.Application

SystemManager.oApp = Word.Application

Private Sub oApp_DocumentBeforeSave(ByVal Doc As Document, _
  SaveAsUI As Boolean, Cancel As Boolean)

With Dialogs(wdDialogFileSaveAs)
                .name = "SomeSpecificFileName"
                .Show
            End With
End Sub
My Issue is, when I use the dialog like the above, It simple "forget" the path selected in the recent history on "Save As" tab,

If I instead put the following in to the code, it will open the save as dialog in the rigth folder.
Code:
Public WithEvents oApp As Word.Application

SystemManager.oApp = Word.Application

Private Sub oApp_DocumentBeforeSave(ByVal Doc As Document, _
  SaveAsUI As Boolean, Cancel As Boolean)

With Dialogs(wdDialogFileSaveAs)
                .name = "C:\Temp\SomeSpecificFileName"
                .Show
            End With
End Sub
My question is how can I get the path of the selected folder from the "Save As" tab?

Reply With Quote