Table of contents
TOC
折叠目录
展开目录

SlideRange.SlideID 属性 (PowerPoint)SlideRange.SlideID Property (PowerPoint)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回指定幻灯片的唯一 ID 号。只读。Returns a unique ID number for the specified slide. Read-only.

语法Syntax

表达式SlideIDexpression. SlideID

表达式_一个表示一个SlideRange对象的变量。_expression A variable that represents a SlideRange object.

返回值Return Value

LongLong

注解Remarks

SlideIndex属性中,添加到演示文稿的幻灯片或重新排列在演示文稿中的幻灯片时,不会改变幻灯片对象的SlideID属性。因此,使用幻灯片 ID 号的FindBySlideID方法可以从幻灯片比使用Item方法与幻灯片的索引号集合中返回一个特定的幻灯片对象的更可靠方法。Unlike the SlideIndex property, the SlideID property of a Slide object won't change when you add slides to the presentation or rearrange the slides in the presentation. Therefore, using the FindBySlideID method with the slide's ID number can be a more reliable way to return a specific Slide object from a Slides collection than using the Item method with the slide's index number.

示例Example

此示例演示如何检索为幻灯片对象的唯一 ID 号,然后使用此数字来从幻灯片集合中返回该幻灯片对象。This example demonstrates how to retrieve the unique ID number for a Slide object and then use this number to return that Slide object from the Slides collection.

Set gslides = ActivePresentation.Slides

'Get slide ID
graphSlideID = gslides.Add(2, ppLayoutChart).SlideID

gslides.FindBySlideID(graphSlideID) _
    .SlideShowTransition.EntryEffect = _
    ppEffectCoverLeft      'Use ID to return specific slide

另请参阅See also

概念Concepts

SlideRange 对象SlideRange Object

© 2018 Microsoft