Ich versuche gerade mit dem FileDialog-Objekt ein Speicherdialog zu erstellen und habe mir dazu das Sample File von Autodesk angeschaut:
Code:Public Sub TestFileDialog() ' Create a new FileDialog object. Dim oFileDlg As FileDialog Call ThisApplication.CreateFileDialog(oFileDlg)
' Define the filter to select part and assembly files or any file. oFileDlg.Filter = "Inventor Files (*.iam;*.ipt)|*.iam;*.ipt|All Files (*.*)|*.*"
' Define the part and assembly files filter to be the default filter. oFileDlg.FilterIndex = 1
' Set the title for the dialog. oFileDlg.DialogTitle = "Open File Test"
' Set the initial directory that will be displayed in the dialog. oFileDlg.InitialDirectory = "C:\Temp"
' Set the flag so an error will be raised if the user clicks the Cancel button. oFileDlg.CancelError = True
' Show the open dialog. The same procedure is also used for the Save dialog. ' The commented code can be used for the Save dialog. On Error Resume Next oFileDlg.ShowOpen ' oFileDlg.ShowSave
' If an error was raised, the user clicked cancel, otherwise display the filename. If Err Then MsgBox "User cancelled out of dialog" ElseIf oFileDlg.FileName <> "" Then MsgBox "File " & oFileDlg.FileName & " was selected." End If End Sub
Bei diesem Sample wird im Öffnen-Dialog das InitialDirectory berücksichtigt, wähle ich aber den Speichern-Dialog, wird das InitialDirectory nicht berücksichtigt und es wird ein anderes Verzeichnis gezeigt. Wird das InitialDirectory im Speichern-Dialog nicht unterstützt oder habe ich bei mir was zerschossen?
erstellt am: 07. Dez. 2020 12:18 <-- editieren / zitieren --> Unities abgeben: Nur für OibelTroibel
Ich denke dies dient der gewollten Funktion der Dateinamenvorbelegung wenn ein neues Dokument gespeichert werden soll "Bauteil1.ipt". Wissen tu ich es aber nicht.