KB0206:thinkcell 使用了错误的字体颜色
问题
thinkcell 未使用我的 PowerPoint 模板中定义的正文主颜色。
解决方案
该问题由 PowerPoint 中的错误引起。截至 2017 年 7 月,Microsoft 已在 Office 365 和 Office 2016 中修复此问题。Office 365 和 Office 2016 即点即用版本通过更新到 版本 1706(内部版本 8229.2073)获得了该修复。基于 MSI 的 Office 2016 版本的修复包含在 KB3203481 中。
如果您的 Office 版本尚未修复,说明和解决方法如下
thinkcell 会尝试根据 PowerPoint 模板提供的字体颜色来确定正确的字体颜色。如果 幻灯片母版顶层幻灯片上缺少某些占位符,含有该错误的 PowerPoint 版本会向 thinkcell 返回错误的字体颜色值。即使不使用 thinkcell,也可以重现此问题。 阅读更多
不使用 thinkcell 进行复现
以下宏会插入一张新幻灯片,其中包含一个文本框,显示 PowerPoint 幻灯片母版中每个 TextStyleLevel 的最终字体颜色值。"TextStyleLevel[1]" 显示 PowerPoint 提供的主字体颜色。
- 打开受影响的 PowerPoint 文件,并按 Alt + F11 打开 VBA 编辑器
- 在 VBA 编辑器中,选择您的演示文稿,然后单击 Insert > New module
- 粘贴以下宏并关闭 VBA 编辑器
- 在 PowerPoint 演示文稿窗口中,按 Alt + F8 打开 Macro 窗口
- 选择 Demonstrate 并单击 Run
Function AppendToTextRange(txtfrm2 As PowerPoint.TextFrame2) As Office.TextRange2
Set AppendToTextRange = _
txtfrm2.TextRange.Characters(txtfrm2.TextRange.Length + 1, 0)
End Function
Sub Demonstrate()
Dim pres As PowerPoint.Presentation
Set pres = ActivePresentation
Dim sld As PowerPoint.Slide
Set sld = pres.Slides.Add(pres.Slides.Count + 1, PowerPoint.ppLayoutBlank)
sld.Select
Dim mstr As PowerPoint.Master
Set mstr = sld.Design.SlideMaster
Dim shp As PowerPoint.Shape
Set shp = sld.Shapes.AddShape(Office.msoShapeRectangle, 50, 50, _
pres.PageSetup.SlideWidth / 2 - 50, pres.PageSetup.SlideHeight - 100)
shp.Fill.ForeColor.RGB = RGB(255, 255, 122) 'light yellow backgound
Dim txtfrm2 As PowerPoint.TextFrame2
Set txtfrm2 = shp.TextFrame2
Dim txtrng2 As Office.TextRange2
Dim i As Integer
i = 1
Dim txtlvl As PowerPoint.TextStyleLevel
For Each txtlvl In mstr.TextStyles(PowerPoint.ppBodyStyle).Levels
Set txtrng2 = AppendToTextRange(txtfrm2)
txtrng2.Text = "TextStyleLevel[" & i & "] has color " & vbCr
txtrng2.Font.Fill.Solid
txtrng2.Font.Fill.ForeColor.ObjectThemeColor = Office.msoThemeColorText1
Set txtrng2 = AppendToTextRange(txtfrm2)
Dim col As PowerPoint.ColorFormat
Set col = txtlvl.Font.Color
If PowerPoint.ppSchemeColorMixed = col.Type Then
txtrng2.Text = "MIXED (should not occur)" & vbCr & vbCr
Else
If Office.msoNotThemeColor = col.ObjectThemeColor Then
Dim nRgb As Long
nRgb = col.RGB()
txtrng2.Text = "RGB: " & (nRgb Mod 256) & "/" & ((nRgb \ 256) _
Mod 256) & "/" & (nRgb \ 256 \ 256) & vbCr & vbCr
txtrng2.Font.Fill.ForeColor.RGB = nRgb
Else
txtrng2.Text = "ObjectThemeColor: " & col.ObjectThemeColor _
& vbCr & vbCr
txtrng2.Font.Fill.ForeColor.ObjectThemeColor = col.ObjectThemeColor
End If
End If
i = i + 1
Next txtlvl
End Sub
解决方法
在 PowerPoint 演示文稿的幻灯片母版上插入缺失的占位符:
- 打开幻灯片母版:PowerPoint > View > Master Views > Slide Master
- 转到缩略图侧边栏中的顶层幻灯片
- 在大多数情况下,插入缺失的 Text 和/或 Title 占位符即可解决问题:
Master Layout > Master Layout > 勾选 Text 和/或 Title> OK - 关闭幻灯片母版:Close > Close Master View
- 插入新图表或更新现有图表,例如将它们拖到新位置
如果之后问题仍然出现,请重复这些步骤,但在第 3 步中勾选所有缺失的占位符。模板或演示文稿可能包含多个受影响的幻灯片母版;请对它们全部应用此解决方法。
您可能希望将此解决方法加入您的 PowerPoint 模板,或联系负责 PowerPoint 模板的人员更新您的默认模板。
如果您的公司有 Microsoft Office 支持合同,并且您也希望 Microsoft 修复您的 Office 版本,请引用我们的 Microsoft 案例编号 116080514511540。
联系支持团队
如果您使用的是已修复的 Office 版本或已应用解决方法,但 thinkcell 仍未使用正确的字体颜色,请将示例幻灯片发送给 我们的支持团队,并告知我们您偏好的字体颜色。