How to Extend Selection to whole paragraph via VBA

∥☆過路亽.° 提交于 2019-12-25 04:11:43

问题


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

回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/40759119/how-to-extend-selection-to-whole-paragraph-via-vba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!