我尝试在PPT中使用VBA编写代码,之前在Excel中也做过一些,但是我需要帮助来完成这个任务...
我有一百多个字符串列表,我想让它们在同一页幻灯片上淡入淡出,每次显示一个字符串大约3秒钟左右。并且持续进行,直到用户通过CTRL + break停止。我已经编写了一些代码,但不确定下一步该怎么做...
Option Explicit
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Test()
'Start the presentation
ActivePresentation.SlideShowSettings.Run
'Change the value of the text box to String1 and fade in the text
ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text = "String1"
DoEvents
'Wait 2 secounds, fade out the Hello! Sting
Sleep 2000
'Fade in the new string.. String2!
ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text = "String2"
DoEvents
'A Loop to keep going back and forth between the 2 (there will be many more later....
'Until stoped by the user [CTRL + BREAK]
End Sub
Option Explicit
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Test()
'Start the presentation
ActivePresentation.SlideShowSettings.Run
'Change the value of the text box to String1 and fade in the text
ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text = "String1"
DoEvents
'Wait 2 secounds, fade out the Hello! Sting
Sleep 2000
'Fade in the new string.. String2!
ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text = "String2"
DoEvents
'A Loop to keep going back and forth between the 2 (there will be many more later....
'Until stoped by the user [CTRL + BREAK]
End Sub
我非常感谢论坛/人们提供的任何帮助..谢谢!!
Skyhawk
Option Explicit
。 - TheEngineer