How to copy a formatted paragraph from Word 2013 to Excel?

前端 未结 3 1431
陌清茗
陌清茗 2021-01-14 00:40

I want to open a Word document and copy each formatted paragraph into its own cell in an Excel worksheet, retaining the formatting for further processing. I have been able t

3条回答
  •  梦谈多话
    2021-01-14 01:30

    For reference, the updated sub code is:

       Private Sub Load_Schedule()
        Dim ParaCount As Integer
        Sheets(FileName).Activate
        Sheets(FileName).Columns(1).AutoFit
        For ParaCount = 1 To wDoc.Paragraphs.Count
            wDoc.Paragraphs(ParaCount).Range.Copy
            Sheets(FileName).Range("A1").Offset(ParaCount, 0).Activate
            Sheets(FileName).Paste
        Next ParaCount
    End Sub
    

提交回复
热议问题