form1.frm

来自「这里有很多很实用的VB编程案例,方便大家学习VB.」· FRM 代码 · 共 63 行

FRM
63
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "OLE控件"
   ClientHeight    =   2235
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3570
   LinkTopic       =   "Form1"
   ScaleHeight     =   2235
   ScaleWidth      =   3570
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "调用Word文件"
      Height          =   495
      Left            =   1080
      TabIndex        =   2
      Top             =   240
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退出"
      Height          =   495
      Left            =   1200
      TabIndex        =   1
      Top             =   960
      Width           =   1215
   End
   Begin VB.OLE OLE1 
      CausesValidation=   0   'False
      Class           =   "Word.Document.8"
      Height          =   495
      Left            =   240
      OleObjectBlob   =   "Form1.frx":0000
      TabIndex        =   0
      Top             =   240
      Visible         =   0   'False
      Width           =   495
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    End
End Sub

Private Sub Command2_Click()
    FileName = App.Path + "\zmhh.doc"
    '调用Word文档。
    OLE1.SourceDoc = FileName
    OLE1.SourceItem = FileName
    OLE1.Action = 1
    OLE1.Action = 7
End Sub

Private Sub Form_Load()
    '将窗体移动屏幕中央。
    Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
    Me.Show
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?