使用excel VBA更改PowerPoint中页眉/页脚日期和时间的格式

问题描述 投票:0回答:2

我目前具有以下设置。一切工作正常,除了.DateAndTime.Format不会更改幻灯片左下角的日期格式。日期显示为4/10/2020,但是我无法使用以下内容将其更改为2020年4月10日:

  Set PowerPointApp = GetObject(class:="PowerPoint.Application")
  Set myPresentation = PowerPointApp.Presentations.Add
    myPresentation.ApplyTemplate "[template file here]"
  Const ppSlideSizeA4Paper = 2
    myPresentation.PageSetup.SlideSize = ppSlideSizeA4Paper
  With myPresentation.SlideMaster.HeadersFooters

    .SlideNumber.Visible = True
    .DateAndTime.Visible = True
    .DateAndTime.UseFormat = True
    .DateAndTime.Format = ppDateTimeMMMMdyyyy

  End With
vba powerpoint datetime-format headerfooter
2个回答
0
投票

[如果您使用的是后期绑定,则类似于


0
投票

我认为您发现了一个错误,因为VBA不会更改母版或其子版式上的日期格式。可以在幻灯片上设置:

© www.soinside.com 2019 - 2024. All rights reserved.