Document..::.Content Property (2007 System) Home
This page is specific to:.NET Framework Version:2.03.54.0
Visual Studio Tools for Office API Reference
Document..::.Content Property (2007 System)

Gets a Range that represents the main document story.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax

'Usage

Dim instance As Document
Dim value As Range

value = instance.Content


'Declaration

<BrowsableAttribute(False)> _
Public ReadOnly Property Content As Range

Property Value

Type: Microsoft.Office.Interop.Word..::.Range
A Range that represents the main document story.
Examples

The following code example adds text to the first paragraph in the document and then creates a range that includes all of the content in the document. The code then sets the font size for the contents of the range to 24.

This example is for a document-level customization.

Private Sub DocumentContent()
    Me.Paragraphs(1).Range.InsertParagraphAfter()
    Me.Paragraphs(1).Range.Text = "This is some sample text."
    Dim myRange As Word.Range = Me.Content
    myRange.Font.Size = 24
End Sub


Permissions

See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View