PPT中如何批量修改字体颜色和大小

2024-11-21 18:12:05
推荐回答(1个)
回答(1):

即可实现,看图操作吧!
sub
oed01()
'批量修改字体格式、大小和颜色
dim
oshape
as
shape
dim
oslide
as
slide
dim
otxtrange
as
textrange
on
error
resume
next
for
each
oslide
in
activepresentation.slides
for
each
oshape
in
oslide.shapes
set
otxtrange
=
oshape.textframe.textrange
if
not
isnull(otxtrange)
then
with
otxtrange.font
.name
=
"楷体_gb2312"
'改成你需要的字体
.size
=
20
'改成你需要的文字大小
.color.rgb
=
rgb(red:=255,
green:=0,
blue:=0)
'改成你想要的文字颜色
end
with
end
if
next
next
end
sub
//更改具备相同文字区域的ppt批量修改(跟据上面的例字整理所得)
sub
aa()
'
'
宏由
wsqxushui
创建,日期
2011-3-16。
'
dim
oshape
as
shape
dim
oslide
as
slide
dim
otxtrange
as
textrange
on
error
resume
next
for
each
oslide
in
activepresentation.slides
'遍历所有的幻灯片
set
oshape
=
oslide.shapes("text
box
4")
'每个幻灯片中文字区域
set
otxtrange
=
oshape.textframe.textrange
'每个区域中文字
if
not
isnull(otxtrange)
then
with
otxtrange.font
.name
=
"宋体"
'改成你需要的字体
.size
=
14
'改成你需要的文字大小
.color.rgb
=
black
'改成你想要的文字颜色
end
with
end
if
next
end
sub