Link to home
Start Free TrialLog in
Avatar of rolandkg1001
rolandkg1001Flag for Austria

asked on

How to use wdDialogFileOpen with default path and default name on the top of the dialog

Hi,

I have implemented the function Vorlageoeffnen, which is attached, in a winword 2003 vba.

My problem:

I want to open the dialog window with a default path which should be the path of the winword application itself. My solution does not work for some reason.

Second:
It would be fine, if i could change the name in the top of the dialog from "Öffnen", or "Open" in English to a diffrent name.

Thanks for any help in advance
Public Function Vorlageoeffnen()
Dim dialOpen As Dialog
Set dialOpen = Dialogs(wdDialogFileOpen)
With dialOpen
'       .Name = Application.ActiveDocument.Path
ChangeFileOpenDirectory (Application.ActiveDocument.Path) & "\"
       .Name = "*.xls"
       .Display
       strExcelDaten = .Name
   
End With
Set doc = Application.ActiveDocument
If dialOpen.Name <> "*.xls" Then
    Ausfuellen
Else
    If doc.ProtectionType = wdNoProtection Then doc.Protect wdAllowOnlyFormFields, NoReset:=True
    Unload frmWarten
    Exit Function
End If
 
End Function

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of irudyk
irudyk
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rolandkg1001

ASKER

Thanks, that works perfect for me. Your solution is excactly, what I was looking for. Great!