Dim strLastfile2 As String
'获取历史文件的数目
Line Input #1, strLastfile2
iMaxLastfile = Int(strLastfile2)
Dim i As Integer
'添加历史文件到ActiveBar菜单,先在ActiveBar中预设4各Command和一个分割线。并把他们的Visible=False
For i = 1 To iMaxLastfile
Line Input #1, strLastfile2
strLastfile(i - 1) = Mid(strLastfile2, 2, Len(strLastfile2) - 2)‘去引号
AABar.Bands("MenuFile").Tools.item(i + 10).Caption = strLastfile(i - 1)
AABar.Bands("MenuFile").Tools.item(i + 10).Visible = True
Next
'关闭文件
Close #1
'设置分隔条
If iMaxLastfile <> 0 Then
AABar.Bands("MenuFile").Tools.item(15).Visible = True
End If
三、在Form_Unload中添加如下代码,将打开文件记录写入配置文件。