求PPT换主题(设计里的主题)的宏代码 PPT 2016 ppt宏代码
求写PPT宏代码
PPT中常用宏代码
倒计时宏代码
Option Explicit
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Tmr()
'Just in the eventuality that you click the start button twice
'isRunning stores the current state of the macro
'TRUE = Running; FALSE = Idle
Static isRunning As Boolean
If isRunning = True Then
End
Else
isRunning = True
Dim TMinus As Integer
Dim xtime As Date
xtime = Now
'On Slide 1, Shape 1 is the textbox
With ActivePresentation.Slides(1)
.Shapes(2).TextFrame.TextRange.Text = "Ladies & Gentlemen." & vbCrLf & _ "Please be seated. We are about to begin."
With .Shapes(1)
'Countdown in seconds
TMinus = 120
Do While (TMinus > -1)
' Suspend program execution for 1 second (1000 milliseconds)
Sleep 1000
xtime = Now
.TextFrame.TextRange.Text = Format(TimeValue(Format(Now, "hh:mm:ss")) - _ TimeSerial(Hour(Now), Minute(Now), Second(Now) + TMinus), "hh:mm:s
请编一个在Powerpoint上运行的宏命令(VBA)代码,解决批量替换或删除多个PPT文件中指定字符的问题。
复制下面宏,使用时点击宏中的“批量替换”即可:
注意:使用前请把要替换的PPT文件复制到同一目录下,以便集中替换。
Sub 批量替换()
Dim ChangedCount As Integer
Dim FileName As String, Mask As String
Dim FindCount As Long
Dim CurPresentation As Presentation
Dim Path As String, FindString As String, ReplaceString As String
Dim oSld As Slide
Dim oShp As Shape
Dim oTxtRng As TextRange
Dim oTmpRng As TextRange
Path = InputBox("请输入路径名称:", "参数输入(1/3)")
FindString = InputBox("请输入查找文本:", "参数输入(2/3)")
ReplaceString = InputBox("请输入替换文本:", "参数输入(3/3)")
If Path = "" Or FindString = "" Or ReplaceString = "" Then
MsgBox "每个参数均不能为空!", vbCritical, "出错"
Exit Sub
End If
ChangedCount = 0
FindCount = 0
Mask = "*.ppt"
If Right(Path, 1) <> "\" Then Path = Path & "\"
FileName = Dir(Path & Mask)
On Error Resume Next
Err.Clear
Do Until FileName = ""
DoEvents
Set CurPresentation = Presentations.Open(FileName:=Path & FileName, ReadOnly:=msoFalse, WithWindow:=msoFalse)
For Each oSld In CurPresentation.Slides
For Each oShp In oSld.Shapes
Err.Clear
Set oTxtRng = oShp.TextFrame.TextRange
If Err.Number = 0 Then
Set oTmpRng = oTxtRng.Replace(FindWhat:=FindString, _
Replacewhat:=ReplaceString, MatchCase:=False, _
WholeWords:=True)
If oTmpRng Is Nothing Then oTxtRng = Replace(oTxtRng, FindString, ReplaceString, , , vbTextCompare)'解决中文无法替换问题(下同)
Do While Not oTmpRng Is Nothing
FindCount = FindCount + 1
Set oTxtRng = oTxtRng.Characters(oTmpRng.Start + oTmpRng.Length, _
oTxtRng.Length)
Set oTmpRng = oTxtRng.Replace(FindWhat:=FindString, _
Replacewhat:=ReplaceString, MatchCase:=False, _
WholeWords:=True)
If oTmpRng Is Nothing Then oTxtRng = Replace(oTxtRng, FindString, ReplaceString, , , vbTextCompare)
Loop
End If
Next oShp
Next oSld
CurPresentation.Save
CurPresentation.Close
FileName = Dir
Loop
MsgBox "替换完毕!"
Close
End Sub
ppt2016有没有角度主题
不同版本的PPT有些内置有区别,如果PPT2016中内置主题没有“角度”,可以从其他版本导入角度主题。比如打开PPT2010,单击设计选项卡,单击主题组后面的倒三角,在打开的主题面板中选择角度主题样式,然后单击保存当前主题,选择保存位置,比如优盘、电脑盘符。再打开PPT2016(没有PPT2016,以PPT2010为例),单击设计选项卡,打开主题面板,单击浏览主题,选择保存的主题,最后单击应用即可。
幻灯片(ppt)里的“宏”是什么?
ppt宏是指自己编写的命令。
可以通过编写宏来让office里的软件自动执行一系列操作。至于宏的作用,对于经常使用office的人来说还是比较大的,比如批量处理文章内文字的替换,修改等等。
宏也是一种操作命令,它和菜单操作命令都是一样的,只是它们对数据库施加作用的时间有所不同,作用时的条件也有所不同。
使用方法如下:
1、打开PPT文件。
2、点击文件选项卡之后,我们可以看到下拉列表,然后我们选择图中的选项
3、选择之后,我们可以看到系统弹出的对话框,这里会有一个信任中心的选项,在这个信任中心的选项中我们可以进行相关的设置,这里有很多的安全设置方式。
4、点击信任中心,我们在信任中心对话框中右侧下方的按钮,这里是信任中心设置按钮,点击这个按钮,我们可以进行这个信任中心中的设置。
5、打开信任中心设置之后,我们可以看到相关于宏的设置,我们可以看到有使用宏,启用宏,以及禁用宏,进行哪一种设置就选中哪一个选项,然后点击确定。