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

View.ScrollShapeIntoView Method (Publisher)

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

Scrolls the publication window so that the specified shape is displayed in the publication window or pane.

Syntax

expression. ScrollShapeIntoView( Shape)

_expression_A variable that represents a View object.

Parameters

NameRequired/OptionalData TypeDescription
ShapeRequiredShapeThe shape to scroll into view.

Example

This example adds a shape to a new page and scrolls the current view to the new shape.

Sub ScrollIntoView() 
 Dim shpStar As Shape 
 Dim intWidth As Integer 
 Dim intHeight As Integer 

 With ActiveDocument 
 intWidth = .PageSetup.PageWidth 
 intWidth = (intWidth / 2) - 75 
 intHeight = .PageSetup.PageHeight 
 intHeight = (intHeight / 2) - 75 

 With .Pages.Add(Count:=1, After:=ActiveDocument.Pages.Count) 
 Set shpStar = .Shapes.AddShape(Type:=msoShape5pointStar, _ 
 Left:=intWidth, Top:=intHeight, Width:=150, Height:=150) 
 shpStar.TextFrame.TextRange.Text = "New Star Shape" 
 End With 
 End With 

 ActiveView.ScrollShapeIntoView Shape:=shpStar 

End Sub
© 2018 Microsoft