-
Hi Tony.
No, I not give the errors, but I not have mthod to add this property (FaceId) for my button.

I was modernized your macro. Please see below:
[vba]Dim cb As CommandBar
Dim mBtn As CommandBarButton
Dim dirRF As CommandBarButton
Dim clearRF As CommandBarButton
Dim bb As CommandBarButton
Dim i As Long
Dim rf As RecentFile
Sub buttonMenu()
On Error Resume Next
Set cb = CommandBars.Add("btnPopup", msoBarPopup)
For Each rf In Application.RecentFiles
If Len(Dir(rf.Path & "\" & rf.Name)) = 0 Then
Application.RecentFiles(rf.Index).Delete
End If
Next rf
For i = 1 To Application.RecentFiles.Count
Set mBtn = cb.Controls.Add(msoControlButton)
With mBtn
.Caption = Application.RecentFiles(i)
.Tag = Application.RecentFiles(i).Path & "\" & Application.RecentFiles(i).Name
.OnAction = "openRF"
End With
Next i
Set dirRF = cb.Controls.Add(msoControlButton)
With dirRF
.Caption = "More docs..."
.BeginGroup = True
'.OnAction = "openDlgRF"
.FaceId = 1661
End With
Set clearRF = cb.Controls.Add(msoControlButton)
With clearRF
.Caption = "Clear list"
.BeginGroup = True
'.OnAction = "clearMRU"
.FaceId = 1088
End With
With CommandBars.ActionControl
' .TooltipText = "List of recent files"
cb.ShowPopup .Left + 25, .Top + .Height - 24
End With
Set cb = Nothing
Set mBtn = Nothing
Set dirRF = Nothing
Set clearRF = Nothing
End Sub
Sub openRF()
Documents.Open CommandBars.ActionControl.Tag
End Sub[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules