An implementation of Visual Basic that is built into Microsoft products.
Hello @SteveD ,
Thanks for your question.
I see one small issue with the InitialFileName line. The folder path is missing a backslash () before the wildcard, which can cause the initial folder to not resolve properly. I recommend these following code:
Sub OpenForm2()
Const strFolder As String = "C:\Tab Form\Input Stakes\"
Dim doc As Document
With Application.FileDialog(FileDialogType:=1) ' 1 = msoFileDialogOpen
.Filters.Clear
.Filters.Add Description:="Word documents (*.doc*)", Extensions:="*.doc*"
.InitialFileName = strFolder & "*.doc*"
If .Show Then
Set doc = Documents.Open(FileName:=.SelectedItems(1))
Else
Beep
Exit Sub
End If
End With
End Sub
Please try and let me know if it works.
I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.