zoukankan      html  css  js  c++  java
  • VBA读取word中的内容到Excel中

    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
  • 相关阅读:
    老陈与小石头运算代码
    第五次作业
    老陈与小石头
    简易四则运算
    四则运算
    对git的认识
    第一次作业
    arcgis-tomcat-cors
    jquery deferred promise
    springloaded hot deploy
  • 原文地址:https://www.cnblogs.com/top5/p/1829480.html
Copyright © 2011-2022 走看看