Document object (Publisher)
Represents a publication.
Remarks
Use the ActiveDocument property to refer to the current publication.
Example
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 previous 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
Methods
- BeginCustomUndoAction
- ChangeDocument
- Close
- ConvertPublicationType
- EndCustomUndoAction
- ExportAsFixedFormat
- FindShapeByWizardTag
- FindShapesByTag
- PrintOutEx
- Redo
- Save
- SaveAs
- SetBusinessInformation
- Undo
- UndoClear
- UpdateOLEObjects
- WebPagePreview
Properties
- 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
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.