选择并复制选择范围字宏中的所有段落

问题描述 投票:0回答:1

我需要选择并复制所有已选择甚至未完全选择的段落。我只是不想用鼠标完全选择它们并复制它们。

我知道如何选择并复制一段:

Sub Copy()
Selection.Paragraphs(1).Range.Select

If Selection.Type = wdSelectionNormal Then
    Selection.Copy
End If
End Sub

但我需要选择并复制所有在选择中受到某种影响的段落。

ms-word macros selection paragraph
1个回答
0
投票

类似的东西

Dim r As Word.Range
Set r = Selection.Range
r.Expand wdParagraph
' If you actually need to copy, but maybe you could use r.FormattedText, depending on what you're trying to do.
r.Copy
' ...and eventually
Set r = Nothing
© www.soinside.com 2019 - 2024. All rights reserved.