header - 主要和偶数标题中的 MS Word 文本框(第 2 部分)
问题描述
我无法让我的第二个文本框显示在偶数页标题中。当我运行以下代码时,两个文本框都显示在主标题中。请注意,标题中存在现有文本,我将单独留下。
''' Dim Box As Shape Dim Box2 As Shape Dim ndx As Integer
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)
Set Box = .Shapes.AddTextbox( _
Orientation:=msoTextOrientationHorizontal, _
Left:=InchesToPoints(1), Top:=InchesToPoints(0.5), Width:=InchesToPoints(4.8), Height:=InchesToPoints(0.37))
End With
With Box.TextFrame.TextRange
.Bold = True
.Font.Size = 8
.Text = "This is a sample policy from another school district. Contents do not necessarily reflect official " & _
vbCrLf & "MSBA policy, represent MSBA legal advice or service, and are not intended for exact replication."
End With
If ActiveDocument.ActiveWindow.Panes(1).pages.Count > 1 Then
With ActiveDocument.Sections(1).Headers(wdHeaderFooterEvenPages)
.Range.InsertAfter " "
Set Box2 = .Shapes.AddTextbox( _
Orientation:=msoTextOrientationHorizontal, _
Left:=InchesToPoints(3), Top:=InchesToPoints(0.5), Width:=InchesToPoints(4.8), Height:=InchesToPoints(0.37))
End With
With Box.TextFrame.TextRange
.Bold = True
.Font.Size = 8
.Text = "This is a sample policy from another school district. Contents do not necessarily reflect official " & _
vbCrLf & "MSBA policy, represent MSBA legal advice or service, and are not intended for exact replication."
End With
End If
'''
我很感激帮助。苏珊
解决方案
推荐阅读
- javascript - 如果没有可显示的内容,则禁用选择
- indy - TIDTCPClient EAccessViolation
- javascript - Javascript函数覆盖提交函数
- python - 如何按账户拆分训练数据和测试数据(一个变量)
- javascript - 使用带有动态项目数组的 react-spring useSprings
- python - 具有两个分类变量的 Matplotlib 点图
- javascript - 当我运行 index.html 时 android 没有检测到我的 .css 和 .js 文件怎么办?
- node.js - 是否可以将功能从服务器发送到客户端?
- c# - How to create dynamic type DbSet in Entity Framework .Net Core application?
- yii2 - How to give active class to clicked button in Yii2