Word has words,characters,sentences, paragraph,sections specific meanings are as follows
Object returned by expression meaning
Words (index) Word Range
Characters (index) character Range
Sentences (index) sentence Range
Paragraphs (index) Paragraph Paragraph
Sections (Index) section
In general, a document is composed of several sections (Sections), a section with several paragraphs (paragraphs),
Each paragraph has a few sentences (sentences) composition, each sentence and a few words words composition, each word has a few characters composition
The following documents, there are two sections, three paragraphs, probably as follows, see annex
Excelhome is a good site, you are not just execl home, but also word,ppt home, we all like you. I hope you're doing better.
Gisoracle is a good person and he does a lot of software about Word,ppt. such as word turn picture Pdf,word numbering tool, Word to picture word;ppt convert picture pdf,ppt convert picture ppt, I want his software.
--There are section breaks
Microsoft Office is doing well and believes he will do better.
VBA is as follows
Private Sub CommandButton1_Click ()
MsgBox "Current document has" & ActiveDocument.Sections.Count & "section"
Dim I, J as Integer
i = 1
Dim osection as section
For each osection in Activedocument.sections
MsgBox "The current document section" & I & "section:" & OSection.Range.Text
i = i + 1
Next
MsgBox "Current document has" & ActiveDocument.Paragraphs.Count & "segment"
i = 1
Dim Oparagraph as Paragraph
Dim Osentence as Range
For each oparagraph in activedocument.paragraphs
MsgBox "Current document section" & I & "section," Content: "& OParagraph.Range.Text
j = 1
For each osentence in oParagraph.Range.Sentences
MsgBox the contents of the "Current document section" & I & ", section" & J & "sentence:" & Osentence.text
j = j + 1
Next
i = i + 1
Next
i = 1
Dim oword as Range
For each oword in Activedocument.words
MsgBox "Current document section" & I & "Word," content: "& oword. Text
If i = 1 Then
For j = 1 to oword. Characters.count
MsgBox "Current document section" & I & "Word:" & J & "character:" & oword. Characters.item (j). Text
Next
End If
i = i + 1
Next
End Sub
Meanings and usages of sentences, paragraph, etc. in Word