Table of contents
TOC
Collapse the table of content
Expand the table of content

Document Object (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Represents a publication.

Example

Use the ActiveDocument property to refer to the current publication. This example adds a table to the first page of the active publication.

Sub NewTable() 
 With ActiveDocument.Pages(1).Shapes 
 .AddTable NumRows:=3, NumColumns:=3, Left:=72, Top:=300, _ 
 Width:=488, Height:=36 
 With .Item(1).Table.Rows(1) 
 .Cells(1).TextRange.Text = "Column1" 
 .Cells(2).TextRange.Text = "Column2" 
 .Cells(3).TextRange.Text = "Column3" 
 End With 
 End With 
End Sub

You can also write the above routine by using a reference to the ThisDocument module. This example uses a ThisDocument reference instead of ActiveDocument.

Sub PrintPublication() 
 With ThisDocument.Pages(1).Shapes 
 .AddTable NumRows:=3, NumColumns:=3, Left:=72, Top:=300, _ 
 Width:=488, Height:=36 
 With .Item(1).Table.Rows(1) 
 .Cells(1).TextRange.Text = "Column1" 
 .Cells(2).TextRange.Text = "Column2" 
 .Cells(3).TextRange.Text = "Column3" 
 End With 
 End With 
End Sub

Events

Name
BeforeClose
Open
Redo
ShapesAdded
ShapesRemoved
Undo
WizardAfterChange

Methods

Name
BeginCustomUndoAction
ChangeDocument
Close
ConvertPublicationType
EndCustomUndoAction
ExportAsFixedFormat
FindShapeByWizardTag
FindShapesByTag
PrintOutEx
Redo
Save
SaveAs
SetBusinessInformation
Undo
UndoClear
UpdateOLEObjects
WebPagePreview

Properties

Name
ActiveView
ActiveWindow
AdvancedPrintOptions
Application
AvailableBuildingBlocks
BorderArts
ColorScheme
DefaultTabStop
DocumentDirection
EnvelopeVisible
Find
FullName
IsDataSourceConnected
IsWizard
LayoutGuides
MailEnvelope
MailMerge
MasterPages
Name
Pages
PageSetup
Parent
Path
PrintPageBackgrounds
PrintStyle
PublicationType
ReadOnly
RedoActionsAvailable
RemovePersonalInformation
Saved
SaveFormat
ScratchArea
Sections
Selection
Stories
SurplusShapes
Tags
TextStyles
UndoActionsAvailable
ViewBoundaries
ViewGuides
ViewHorizontalBaseLineGuides
ViewTwoPageSpread
ViewVerticalBaseLineGuides
WebNavigationBarSets
Wizard
© 2017 Microsoft