excel - 在链中使用多个样式
问题描述
我需要从 Excel 导入 Word 文档中的一些选项卡,为此我在 Excel 中使用了 VBA。
像这样的东西:
With SelDOCFile.Find
.Forward = True
.Wrap = wdFindContinue
.Execute FindText:="\<FLAG\>"
If .Found Then
For Bank = 0 To Banks - 1
SelDOCFile.InsertCaption Label:="Table", Title:=": Bank " & Bank _
& " [Special" & Bank & "##A]", Position:=wdCaptionPositionAbove, ExcludeLabel:=0
SelDOCFile.HomeKey Unit:=wdLine
SelDOCFile.EndKey Unit:=wdLine, Extend:=wdExtend
SelDOCFile.Font.Size = 10
SelDOCFile.Font.Bold = True
SelDOCFile.Font.Italic = False
SelDOCFile.Font.Name = "Arial"
SelDOCFile.HomeKey Unit:=wdLine
SelDOCFile.MoveRight Unit:=wdWord, Count:=6
SelDOCFile.EndKey Unit:=wdLine, Extend:=wdExtend
SelDOCFile.Style = ActiveDocument.Styles("SpecialFunc")
....
Next Bank
End If
End With
我想要的是在 [] 之间使用不同样式的文本编写 Title:="Table 1: Bank 0 [Special0##A]",但是这里的代码不能按预期工作。我有所不同,但样式没有完全应用,只有颜色、大小……发生了变化,但是当在 Word 中我将光标放在文本上时,它以与标题的其余部分相同的样式出现
有什么建议吗?谢谢
解决方案
推荐阅读
- javascript - UnhandledPromiseRejectionWarning:未处理的承诺拒绝 - Node.js
- javascript - 为什么 ref.deref() 在 Safari 控制台调试中没有结果?
- android-jetpack-compose - 如何在 jetpack compose for desktop-App 中使用 webview
- javascript - 如何在javascript中在这个程序中添加睡眠功能
- reactjs - 反应查询 useQuery,GraphQL + fetch。如何传递变量?
- rust - 如何共享 TlsStream
在经纱请求中 - linux - io_uring 中的最大注册缓冲区大小
- python - CSV:如何从行创建列表并从包含列表的列表中查找列表的最接近值?
- javascript - 尝试通过定位父类名将标题添加到链接(来自小部件)的属性
- a-star - 用于 2x2 魔方求解的 A* 算法中的 h(n) 选择