⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 获得Word中的表
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox Text1 
      Height          =   2055
      Left            =   480
      MultiLine       =   -1  'True
      TabIndex        =   1
      Text            =   "Form1.frx":0000
      Top             =   240
      Width           =   3855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   615
      Left            =   1080
      TabIndex        =   0
      Top             =   2400
      Width           =   2175
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim AppWord As New Word.Application


Private Sub Command1_Click()
    Dim xDoc As Document
    Dim xRange As Range
    
    Set xDoc = AppWord.Documents.Open(App.Path + "\doc1.doc")
    Debug.Print xDoc.Tables.Count
    If xDoc.Tables.Count > 0 Then
        Set xRange = xDoc.Tables(1).ConvertToText
        Text1.Text = xRange.Text
        Debug.Print xRange.Text
    End If
    
    Dim xLink As LinkFormat
    
    Debug.Print xDoc.Fields.Count
    Set xLink = xDoc.Fields(1).LinkFormat
    Debug.Print TypeName(xLink)
'    Debug.Print xLink.SourceName
    xDoc.Close
End Sub

Private Sub Form_Unload(Cancel As Integer)
    AppWord.Quit
End Sub

⌨️ 快捷键说明

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