📄 form1.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "导入和导出收藏夹"
ClientHeight = 2805
ClientLeft = 45
ClientTop = 330
ClientWidth = 2790
LinkTopic = "Form1"
ScaleHeight = 2805
ScaleWidth = 2790
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "设置"
Height = 1332
Left = 120
TabIndex = 2
Top = 120
Width = 2295
Begin VB.OptionButton Option1
Caption = "导出收藏夹"
Height = 372
Left = 120
TabIndex = 4
Top = 240
Width = 1212
End
Begin VB.OptionButton Option2
Caption = "导入收藏夹"
Height = 252
Left = 120
TabIndex = 3
Top = 840
Width = 1212
End
End
Begin MSComDlg.CommonDialog CDlgBookmark
Left = 240
Top = 2040
_ExtentX = 688
_ExtentY = 688
_Version = 393216
End
Begin VB.CommandButton CmdCancel
Caption = "退出程序"
Height = 492
Left = 1200
TabIndex = 1
Top = 2160
Width = 1212
End
Begin VB.CommandButton CmdOK
Caption = "确定"
Height = 492
Left = 1200
TabIndex = 0
Top = 1560
Width = 1212
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim IsImport As Boolean
Private Sub CmdCancel_Click()
End
End Sub
Private Sub CmdOK_Click()
ImportExportBookmark (IsImport)
End Sub
Private Sub Form_Load()
Option1.Value = True
IsImport = False
CDlgBookmark.CancelError = True
'CancelError属性设置为 True 时,无论何时选取“取消”按钮,均产生 32755 (cdlCancel) 号错误。
End Sub
Private Sub ImportExportBookmark(fImport As Boolean)
Dim ObjSUH As SHDocVw.ShellUIHelper
Set ObjSUH = New SHDocVw.ShellUIHelper
If fImport = True Then
CDlgBookmark.DialogTitle = "书签文件导入收藏夹:"
On Error GoTo CancelHandler
CDlgBookmark.ShowOpen
Else
CDlgBookmark.DialogTitle = "收藏夹导出到书签文件:"
On Error GoTo CancelHandler
CDlgBookmark.ShowSave
End If
ObjSUH.ImportExportFavorites fImport, CDlgBookmark.FileName
CancelHandler: '文件对话框选择了“取消”按钮
If Err.Number = cdlCancel Then Exit Sub
End Sub
Private Sub Option1_Click()
IsImport = False
End Sub
Private Sub Option2_Click()
IsImport = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -