1.VBA PPT 文本框设置
Sub Change_WhiteText_toBlack()
On Error Resume Next
Dim i, j As Single
For i = 2 To ActivePresentation.Slides.Count
For j = 1 To ActivePresentation.Slides(i).Shapes.Count
With ActivePresentation.Slides(i).Shapes(j)
If .Fill.BackColor = vbWhite And .TextFrame.TextRange.Font.Color = vbWhite Then
.TextFrame.TextRange.Font.Color = vbBlack
End If
End With
Next
Next
End Sub
插入模块,复制代码到其中。
2.ppt vba 插入一个文本框并且设置文本边框为红色,代码怎么写
With ActivePresentation.Slides(2) With .Shapes.AddTextbox(, 80, 200, 550, 100) .TextFrame.TextRange.Font.Color = vbRed .TextFrame.TextRange.Font.Size = 38 .TextFrame.TextRange.Text = "第二张幻灯片插入了一个文本框" End With End With。
3.ppt vba 回车到达文本框
楼主是指同一个页面的文本框吗?还是到达下一个页面的文本框。
如果是同一个页面,按Ctrl+回车就可以。
如果已经在当前页面的最后一个文本框中,按Ctrl+回车先创建一个新页面,再按一次切到新页面的文本框中。
Ctrl+回车有用的。 试过。
Office2003
用幻灯片母板里的那种文本框之间是可以Ctrl+回车切换的,你自己通过绘图工具栏画的文本框之间不能这样切换。
建议楼主hi我,把你的ppt给我看看,弄清楚情况再说。否则VBA写出来也不符合你的要求,也是白写。
----------------------------------------------
楼主说的是文本框控件,请关注下面两个帖子的答复内容:
/cdb/viewthread.php?tid=111203&extra=page%3D1
以及
/viewthread.php?tid=75943&pid=3138470&page=1&extra=page%3D1
4.怎么用vba在第二张ppt里面插入一个文本框
Sub abc()
With ActivePresentation.Slides(2)
With .Shapes.AddTextbox(, 80, 200, 550, 100)
.TextFrame.TextRange.Font.Color = vbRed
.TextFrame.TextRange.Font.Size = 38
.TextFrame.TextRange.Text = "第二张幻灯片插入了一个文本框"
End With
End With
End Sub
点击图片查看动画效果
5.PPT的VBA中怎样在一张幻灯片中引用另一张幻灯片中的文本框中的内
下面代码是把第二张幻灯片的标题设置为第一张幻灯片的文件框的内容
ActivePresentation.Slides(2).Shapes(1).TextFrame.TextRange.Text = ActivePresentation.Slides(1).Shapes(3).TextFrame.TextRange.Text
下面代码是显示第一张幻灯片中所有文本框的内容,你看着哪个对你有用,用哪个吧
Private Sub CommandButton1_Click()
Dim i As Integer
With ActivePresentation.Slides(1)
For i = 1 To .Shapes.Count
If .Shapes(i).Type = msoTextBox Then
MsgBox .Shapes(i).TextFrame.TextRange.Text
End If
Next
End With
End Sub
6.VB中怎样在PPT中创建一个文本框呢
ActiveWindow.Selection.SlideRange.Shapes.AddTextbox(, 356, 252, 58.625, 28.875).Select ActiveWindow.Selection.ShapeRange.TextFrame.WordWrap = msoTrue With ActiveWindow.Selection.TextRange.ParagraphFormat .LineRuleWithin = msoTrue .SpaceWithin = 1 .LineRuleBefore = msoTrue .SpaceBefore = 0.5 .LineRuleAfter = msoTrue .SpaceAfter = 0 .Alignment = ppAlignRight '''''' End With以上是VBA中的,怎样改成VB6中的呢。
7.高分求解
用 shape 对象的 AnimationSettings 集合对象的 EntryEffect 属性只能添加进入效果,如果要添加强调效果需要利用 slide 对象的 TimeLine 子对象的 MainSequence 子对象的 AddEffect 方法,示例:
Dim shp2 As Shape'定义一个形状对象
Set shp2 = ActivePresentation.Slides(2).Shapes("标题 1")'将要添加效果的形状对象赋值给定义的 shp2,幻灯片编号要自己改,形状的名称要自己改!
ActivePresentation.Slides(2).TimeLine.MainSequence.AddEffect(shp2, msoAnimEffectWave)'在幻灯片 2 的动画序列中添加一个 Effect,针对 shp2 添加 Effect 且类型为 msoAnimEffectWave(波浪形),幻灯片编号要自己改!
8.在ppt vba中,怎样循环取文本框的高度值,并设成一个值
如果您要的效果仅仅是“循环取文本框的高度值,并设成一个值”
那么这样就行咯
Sub 调整对齐文本框()
Dim sld As Slide
Dim sh As Shape
For Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
sh.Height = 28.375
sh.Width = 107.625
Next
Next
End Sub
转载请注明出处育才学习网 » pptvba文本框怎么写