Word レイアウト記録
Word マクロ
相互参照の色付け
Word の相互参照や Endnote/Zotero の相互参照を自動でフォーマットし、デフォルト色を青に設定します。
Sub CitingColor()
For i = 1 To ActiveDocument.Fields.Count 'ドキュメント内のすべてのフィールドを走査
If Left(ActiveDocument.Fields(i).Code, 4) = " REF" Or Left(ActiveDocument.Fields(i).Code, 14) = " ADDIN EN.CITE" Or Left(ActiveDocument.Fields(i).Code, 31) = " ADDIN ZOTERO_ITEM CSL_CITATION" Then 'Word標準の相互参照は" REF"(先頭4文字)、EndNoteは" ADDIN EN.CITE"(先頭14文字)、Zoteroは" ADDIN ZOTERO_ITEM CSL_CITATION"(先頭31文字)。必要に応じて他のタイプも追加可能。
ActiveDocument.Fields(i).Select '上記のフィールドを選択
Selection.Font.Color = RGB(31, 77, 160) 'フォント色を設定
End If
Next
End Sub
Mathtype 一括スケーリング
Mathtype 数式の更新後に一部数式の高さが不揃いになる問題を解決するため、再スケーリングするマクロです。
Sub EqMathtype_100()
'
' EqMathtype_100 Macro
''
Dim i As Integer
Dim total As Integer
total = ActiveDocument.InlineShapes.Count
i = 0
For Each s In ActiveDocument.InlineShapes
i = i + 1
On Error Resume Next
Application.StatusBar = "Progress: " & i & " of " & total
If s.Type = msoAutoShape Then
If s.OLEFormat.ClassType = "Equation.DSMT4" Then
With s
.ScaleHeight = 100
.ScaleWidth = 100
End With
End If
End If
Next
End Sub
この記事を楽しみましたか?
次におすすめの記事はこちら: