Format 属性

       

返回或设置自动更新日期和时间的格式。仅应用于代表日期和时间(由 DateAndTime 属性从 HeadersFooters 集合中返回)的 HeaderFooter 对象。可读写。PpDateTimeFormat 类型。

expression.Format

expression  必选。该表达式返回“应用于”列表中的对象之一。

说明

通过将 UseFormat 属性设置为 True,确保将日期和时间设置为自动更新(不作为固定文本显示)。

示例

本示例将当前演示文稿的幻灯片母版中日期和时间设为自动更新,并将日期和时间格式设为显示小时、分钟和秒。

Set myPres = Application.ActivePresentation
With myPres.SlideMaster.HeadersFooters.DateAndTime
    .UseFormat = True
    .Format = ppDateTimeHmmss
End With