Story object (Publisher)

Represents the text in an unlinked text frame, text flowing between linked text frames, or text in a table cell. The Story object is a member of the TextFrame and TextRange objects and the Stories collection.

Remarks

Use the Story property of the TextFrame or TextRange object to return the Story object in a text frame or text range.

Use Stories (index), where index is the number of the story, to return an individual Story object.

Example

This example returns the story in the selected text range, and if it is in a text frame, inserts text into the text range.

Sub AddTextToStory() 
 With Selection.TextRange.Story 
 If .HasTextFrame Then .TextRange _ 
 .InsertAfter NewText:=vbLf & "This is a test." 
 End With 
End Sub

This example determines if the first story in the active publication has a text frame, and if it does, formats the paragraphs in the story with a half inch first line indent and a six-point spacing before each paragraph.

Sub StoryParagraphFirstLineIndent() 
 With ActiveDocument.Stories(1) 
 If .HasTextFrame Then 
 With .TextFrame.TextRange.ParagraphFormat 
 .FirstLineIndent = InchesToPoints(0.5) 
 .SpaceBefore = 6 
 End With 
 End If 
 End With 
End Sub

Properties

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.