Document.Content Property (Word)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns a Range object that represents the main document story. Read-only.

expression .Content

expression A variable that represents a Document object.

The following two statements are equivalent:

Set mainStory = ActiveDocument.Content 
Set mainStory = ActiveDocument.StoryRanges(wdMainTextStory)

This example changes the font and font size of the text in the active document to Arial 10 point.

Set myRange = ActiveDocument.Content 
With myRange.Font 
 .Name = "Arial" 
 .Size = 10 
End With

This example inserts text at the end of the document named "Changes.doc." The For Each...Next statement is used to determine whether the document is open.

For Each aDocument In Documents 
 If InStr(LCase$(aDocument.Name), "changes.doc") Then 
 Set myRange = Documents("Changes.doc").Content 
 myRange.InsertAfter "the end." 
 End If 
Next aDocument