M
Mike
Hi ! I am programmatically creating a menu in Word 2000 to display Recent
Drafts and Recent Submissions. The requirements specify that upon selecting
Recent from the pulldown menu, the menu should expand to the right displaying
10 recent documents.
So far, I am able to do that. The problem is when I click on one of the
documents listed, I need to call a function called OpenDoc().
My question is: How do I pass the name of the document to this
function/macro ?
Here’s how I build the menu:
Private Sub BuildMenuItem(ByRef pobjCommandBarControls As
Office.CommandBarControls, _
ByRef pobjCommanBarControl As
Office.CommandBarControl, _
ByVal pobjMenuType As Office.MsoControlType, _
ByVal pstrMenuCaption As String, _
ByVal pstrMenuAction As String, _
ByVal pblnCreateDivider As Boolean)
On Error GoTo ErrHandler
With pobjCommandBarControls
Set pobjCommanBarControl = .Add(pobjMenuType)
pobjCommanBarControl.Caption = pstrMenuCaption
If pstrMenuAction <> "" Then
pobjCommanBarControl.OnAction = pstrMenuAction
End If
pobjCommanBarControl.BeginGroup = pblnCreateDivider
' pobjCommanBarControl.Parameter = ??? – How do I use it ?
End With
Exit Sub
ErrHandler:
MsgBox Err.Description
End Sub
Many Thanks in Advance,
--Mike
Drafts and Recent Submissions. The requirements specify that upon selecting
Recent from the pulldown menu, the menu should expand to the right displaying
10 recent documents.
So far, I am able to do that. The problem is when I click on one of the
documents listed, I need to call a function called OpenDoc().
My question is: How do I pass the name of the document to this
function/macro ?
Here’s how I build the menu:
Private Sub BuildMenuItem(ByRef pobjCommandBarControls As
Office.CommandBarControls, _
ByRef pobjCommanBarControl As
Office.CommandBarControl, _
ByVal pobjMenuType As Office.MsoControlType, _
ByVal pstrMenuCaption As String, _
ByVal pstrMenuAction As String, _
ByVal pblnCreateDivider As Boolean)
On Error GoTo ErrHandler
With pobjCommandBarControls
Set pobjCommanBarControl = .Add(pobjMenuType)
pobjCommanBarControl.Caption = pstrMenuCaption
If pstrMenuAction <> "" Then
pobjCommanBarControl.OnAction = pstrMenuAction
End If
pobjCommanBarControl.BeginGroup = pblnCreateDivider
' pobjCommanBarControl.Parameter = ??? – How do I use it ?
End With
Exit Sub
ErrHandler:
MsgBox Err.Description
End Sub
Many Thanks in Advance,
--Mike