How to Extend Selection to whole paragraph via VBA

2019-09-15 18:54发布

I am using this code to extend selection to whole line on word document, Now I want to extend selection to whole paragraph

Selection.Expand wdLine

2条回答
叛逆
2楼-- · 2019-09-15 19:35

Try using a different WdUnit like wdParagraph:

Selection.Expand wdParagraph

See this link for an overview of the different WdUnits: https://msdn.microsoft.com/en-us/library/office/ff838950.aspx

查看更多
Summer. ? 凉城
3楼-- · 2019-09-15 19:39

If you know one of the enumerated values then you can use the Object Explorer to find the name of the Enumeration. By referencing the Enumeration you'll be able to use Intellisense to determine all the valid values.

enter image description here

查看更多
登录 后发表回答