【发布时间】:2014-12-22 03:59:46
【问题描述】:
我在网上搜索了如何执行一项简单任务的结果。 选择命名范围。我不断得到命名范围内文本的重复,而不是选择。带有 cmets 的代码:
Sub SetSelectionFromRange()
' Goal: Set current selection to be that of a named range
' text of doc is "One Two" and at start the insertion bar is between "w" and "o"
Dim myRange4 As Range
Set myRange4 = ActiveDocument.Range(Start:=0, End:=3)
Selection.Range = myRange4.Duplicate
' result expected is "One" selected and no change in text
' result actual is "One TwOneo" and insertion bar left after "w" (no selection)`
End Sub
【问题讨论】:
标签: vba ms-word range selection