怎样用VBA更动某一文件夹下所有PowerPoint文件母版的页脚字体
怎样用VBA更改某一文件夹下所有PowerPoint文件母版的页脚字体?
PowerPoint文件母版页脚有两部分组成,一部分是页码,还有一部分是“Confidential”字样。
现在用的字体是Calibri,需要更改成Arial。
需要将一个文件夹下所有的PowerPoint文件都做这样的改动。
请问应该怎样写啊?
------解决方案--------------------
PowerPoint文件母版页脚有两部分组成,一部分是页码,还有一部分是“Confidential”字样。
现在用的字体是Calibri,需要更改成Arial。
需要将一个文件夹下所有的PowerPoint文件都做这样的改动。
请问应该怎样写啊?
------解决方案--------------------
Sub changeFileFont()
Dim pres As Presentation
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder("c:\1") 'ÔÚÀ¨ºÅÄÚÊäÈëÄãÖ¸¶¨µÄĿ¼
Set fc = f.Files
For Each f1 In fc
If f1 Like "*.pptx" Then
Debug.Print f1
Set pres = Presentations.Open(FileName:=f1)
ActiveWindow.ViewType = ppViewSlideMaster
ActivePresentation.SlideMaster.Shapes("TextBox 7").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=13).Select
With ActiveWindow.Selection.TextRange.Font
.NameAscii = "Arial Unicode MS"
.NameOther = "Arial Unicode MS"
.NameFarEast = "Arial Unicode MS"
End With
ActivePresentation.SlideMaster.Shapes("TextBox 8").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=3).Select
With ActiveWindow.Selection.TextRange.Font
.NameAscii = "Arial Unicode MS"
.NameOther = "Arial Unicode MS"
.NameFarEast = "Arial Unicode MS"
End With
ActiveWindow.ViewType = ppViewSlide
pres.Save
pres.Close
End If
Next
End Sub