U
Udo Weik
Hello,
when I declare the function GetOpenFileName from comdlg32 in
a Visio-VBA-Script, I get the following compiler error:
Only comments may appear after End Sub, End Function, or End Property
Type OPENFILENAME is decalred at the head of the module.
Any hint?
Thanks in advance.
Udo
Code:
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Sub GetFileFromAPI()
Private Declare Function GetOpenFileName _
Lib "comdlg32" Alias "GetOpenFileNameA" ( _
ByRef pOpenfilename As OPENFILENAME _
) As Long
End Sub
when I declare the function GetOpenFileName from comdlg32 in
a Visio-VBA-Script, I get the following compiler error:
Only comments may appear after End Sub, End Function, or End Property
Type OPENFILENAME is decalred at the head of the module.
Any hint?
Thanks in advance.
Udo
Code:
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Sub GetFileFromAPI()
Private Declare Function GetOpenFileName _
Lib "comdlg32" Alias "GetOpenFileNameA" ( _
ByRef pOpenfilename As OPENFILENAME _
) As Long
End Sub