It is possible for the user to select a region in a document that does not represent contiguous text (for example, when using the Alt key with the mouse). However, calling methods like Cut or Copy from a collapsed selection causes an error. For example, the Text property will still return the character to the right of the insertion point this character also appears in the Characters collection of the Selection object. MsgBox Prompt:="You have not selected any text! Exiting procedure."Įven when a selection is collapsed to an insertion point, it is not necessarily empty. Use the following example in a procedure to determine whether there is anything selected in the active document if there is not, the rest of the procedure is skipped. Use properties like Flags, Information, and Type to return information about the current selection. The following example changes the font of the current selection from Times New Roman to Tahoma. The Selection object has various methods and properties with which you can change the formatting of the current selection. The following example deletes the last paragraph of the first document in the Documents collection and pastes it at the beginning of the second document. Selection.TypeText "Material below is confidential." The following example selects the first sentence in the active document and replaces it with a new paragraph. The Selection object has various methods and properties with which you can edit selected text in a document. Selection.MoveUp Unit:=wdLine, Count:=2, Extend:=wdExtend Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.EndOf Unit:=wdStory, Extend:=wdMove The following example moves the insertion point to the end of the document and selects the last three lines. The Selection object has various methods and properties with which you can collapse, expand, or otherwise change the current selection. StrTemp = Left(strTemp, Len(strTemp) - 1) The following example assigns the text in the current selection to the variable strTemp, removing the last character if it is a paragraph mark. Use this property to set or return the text in the current selection. The Text property is the default property of the Selection object. The following example copies the selection from the first pane of the active document and pastes it into the second pane. The document does not have to be active to access its current selection. The following example deletes the selection from the third document in the Documents collection. The following example copies the current selection from the active document. If no object qualifier is used with the Selection property, Microsoft Word returns the selection from the active pane of the active document window. Use the Selection property to return the Selection object. Using VBA Selection commands like Selection.BoldRun on user selection with Comments no longer applies bold formatting on user-selected text or Selection.TypeTxt command or on user selection with Comments no longer inserts text. Obviously I can use a fresh document which has a consistent word count, but if there's a solution I'd like to know what it is so I know I can trust the count.This method has changed. I've tried unselecting and reselecting footnotes, but it just went down to 6,065 (which incidentally appears to be the correct footnoteless number, as the in-window count agrees with that) and then back up to the arbitrary 6,548.Įvidently my document can't "see" 500-odd words, but I'm at my wits' end trying to figure out why! Now though, nothing seems to be able to make the original document catch up, and when I add or delete words it counts upwards or downwards from 6,548. This morning, first thing the document displayed over 7,000, but has now dropped, which is what made me realise it was wrong. I pasted the whole lot into a new document, which then showed 7,045 as the bottom-of-screen count, so that's obviously the correct one. The bottom-of-screen word count it is currently saying "6,548 words" but when I actually click on the word count the in-window count tells me 7,045. However, my document keeps telling me different things. I love the word count at the bottom of the page, and especially the feature that it tells you how many words you're up to, out of how many in total, so if you have notes after the main body of your work you don't have to keep highlighting the relevant section. Very weird word count issue on my new Macbook Air.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |