I think I should post my codes just in case Iam missing something. I tried
your suggestion and it didnt work. I tried it with and without parentheses
around the arguments.
Sub AddDownloadCommandToPIDMenu()
Dim NuBar As Object, MBar As Object, cbrs As Object, PBar As Object,
DBar As Object
Const wgPopupControl% = 10, wgMenuButton% = 1
Set cbrs = CommandBars
Set MBar = CommandBars("Menu Bar")
Set PBar = MBar.FindControl(wgPopupControl, , "PID")
On Error Resume Next
With PBar.Controls
On Error Resume Next
Set DBar = PBar.Controls("Download Duval Data File")
If Not DBar Is Nothing Then DBar.Delete
Set NuBar = .Add(wgMenuButton, , , , True)
With NuBar
.Caption = "Download Data Files"
.OnAction =
"'MenuCommand_DownloadFileFromPIDSite(""somewebaddress.net"",""powerp"",""po
wer2000"",""WAC"",""Trans"",""TrafCivil????????.txt"",""Traffic"",""Jail
Data\Admits"",""20??????.txt"",""Criminal"")'"
End With
End With
Set PBar = Nothing
Set MBar = Nothing
Set NuBar = Nothing
End Sub
And my function declaration looks something like:
Function MenuCommand_DownloadFileFromPIDSite(WebSiteAddress$, Login$,
Password$, AllCountyMoniker$, _
ParamArray Location_FilePattern_Dataset_Trio())