Outlook 2010: SHBrowseForFolder mit voreingestellten Pfad

  • Sonstige

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von petaod.

    Outlook 2010: SHBrowseForFolder mit voreingestellten Pfad

    Hallo



    Quellcode

    1. 'Directory DialogBox Title
    2. Private Const EXM_DIR_TITLE As String = "Datei(en) speichern im Verzeichnis!"
    3. 'Directory DialogBox save path
    4. Private Const EXM_DIR_PATH As String = "C:\Temp"
    5. 'Aufruf: strBackupPath = Get_Folder(EXM_DIR_TITLE, EXM_DIR_PATH)
    6. Private Function Get_Folder(Optional capt, Optional initF)
    7. Dim objShell As Object, objFolder As Object, objItem As Object
    8. Set objShell = CreateObject("Shell.Application")
    9. With objShell
    10. Set objFolder = .BrowseForFolder(0, capt, 0, initF)
    11. 'Set objFolder = .BrowseForFolder(&H0, capt, &H0, initF)
    12. End With
    13. If Not objFolder Is Nothing Then
    14. Set objItem = objFolder.Self
    15. Get_Folder = objItem.Path
    16. ' MsgBox objItem.Path
    17. End If
    18. End Function


    Das Ergebnis ist dann folgebnder Dialog zur Verzeichnisauswahl



    Nun habe ich aber keine Möglichkeit einen anderen Pfad auszuwählen.

    Mit den Optionen von BrowseForFolder habe ich schon herumprobiert, leider ohne Erfolg.

    Hat jemand eine Idee wo das Problem liegt?

    Danke.
    Unter Outlook 2010 müsste folgendes funktionieren:

    Visual Basic-Quellcode

    1. Set fd = Application.FileDialog(msoFileDialogOpen)
    2. fd.Show

    Outlook 2007 scheint den FileDialog nicht an Bord zu haben.
    Da hatte ich mal die Variante, den Excel-Dialog zu vergewaltigen:

    Visual Basic-Quellcode

    1. Dim fd As Office.FileDialog
    2. Set Excel = CreateObject("Excel.Application")
    3. Set fd = Excel.FileDialog(msoFileDialogOpen)
    4. fd.Show
    --
    If Not Program.isWorking Then Code.Debug Else Code.DoNotTouch
    --