试图在我的PPT内VBA第一次去,在Excel中做了一些前..但我需要在那里与这一个去一些帮助......的PowerPoint(VBA?)淡入淡出文本
我有一百个左右的字符串的列表,我想淡入淡出,在同一张幻灯片上,大约3或者每秒钟显示1次。并继续这样做直到用户停止,即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
你只需要每个模块`选项Explicit`一次。 – TheEngineer 2016-06-27 17:01:39