Win10x64 Office365 PPT v16.0.12325.202080 64位
出于可读性的目的,我需要显示一个带有黄色字体颜色但有黑色轮廓的字符。此字符位于Powerpoint表格单元格中。
下面的链接有一个我目前正在使用的方法,包括创建一个虚拟形状,向其中添加文本,修改形状的textframe2字体线条属性,然后将其复制并粘贴回表格单元格中。
http://www.vbaexpress.com/forum/archive/index.php/t-43787.html
这是8年前提出的问题,但我现在看到了同样的行为,我们不能直接操作单元格中的textframe2 wordart格式的文本。程序没有显示错误,但无法工作。
我已经放弃了直接从textrame2修改VBA字体线条属性的尝试。
我已经设法让它使用Application.CommandBars.ExecuteMso ("TextOutlineColorPicker")激活字体轮廓颜色
在它被激活后,我想我可以修改textframe2的字体线条属性,但是它仍然不能工作。
表格单元格内是否有用于更改字体轮廓颜色和字体轮廓线宽的Application.CommandBars idMso?
或者不是将格式化文本粘贴到表格单元格内的另一种方法。
编辑:添加一个图像来说明我所说的文本颜色和文本轮廓颜色,以及用于在红色圆圈中显示它们的菜单:

Edit2添加了另一个快照,以演示带黑色轮廓的单元格中的字符和不带轮廓的单元格中的字符

谢谢
发布于 2020-02-18 05:11:16
下面是一个访问给定幻灯片上的Table并更改单元格属性的示例。我使用的示例幻灯片如下所示

代码本身创建了一个函数,允许您从特定幻灯片中选择一个表格,并在表格中选择一个单元格并将其突出显示。
Option Explicit
Sub test()
HighlightTableCell 1, 2, 3
End Sub
Sub HighlightTableCell(ByVal slideNumber As Long, _
ByVal thisRow As Long, _
ByVal thisCol As Long)
Dim theSlide As Slide
Set theSlide = ActivePresentation.Slides(slideNumber)
Dim shp As Shape
For Each shp In theSlide.Shapes
If shp.Type = msoTable Then
Dim theTable As Table
Set theTable = shp.Table
With theTable.Cell(thisRow, thisCol)
With .Shape.TextFrame2.TextRange.Characters.Font.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 255, 0)
.Transparency = 0
.Solid
End With
With .Shape.TextFrame2.TextRange.Characters.Font.Line
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorText1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
End With
End With
End If
Next shp
End Subhttps://stackoverflow.com/questions/60269916
复制相似问题