Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.45 KB

Publisher.View.ScrollShapeIntoView.md

File metadata and controls

60 lines (42 loc) · 1.45 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
View.ScrollShapeIntoView method (Publisher)
vbapb10.chm327685
vbapb10.chm327685
Publisher.View.ScrollShapeIntoView
1d654fd4-d3b8-49e4-731d-fed27e6e0d8d
06/15/2019
medium

View.ScrollShapeIntoView method (Publisher)

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

Name Required/Optional Data type Description
Shape Required Shape The 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

[!includeSupport and feedback]