Public Sub Duqu()
     Dim myFile As String
    Dim docApp As Word.Application
    Dim docRange As Word.Range
    myFile = ThisWorkbook.Path & "\Word文档的名字"    '指定Word文档
    Set docApp = New Word.Application
    docApp.Documents.Open myFile
    For i = 1 To docApp.ActiveDocument.Paragraphs.Count
    With docApp.ActiveDocument
        'If .Paragraphs.Count >= 4 Then
            Set docRange = .Paragraphs(i).Range
            cp = cp & docRange
            
        'End If
    End With
      
    Next i
    Range("a1") = cp
    docApp.Quit
    Set docRange = Nothing
    Set docApp = Nothing
    Set ws = Nothing
    
End Sub

相关文章:

  • 2021-12-03
  • 2022-01-06
  • 2021-04-30
  • 2022-01-20
  • 2022-12-23
  • 2021-10-08
猜你喜欢
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2021-06-22
  • 2022-02-19
  • 2021-09-22
  • 2021-12-26
相关资源
相似解决方案