Microsoft Word 2010のドキュメントの変更履歴のプロパティ

Pocket

 研究者にとって論文の初版からの変更履歴を記録しておくと最終版との比較に便利です.Word VBA でそのプロパティを調べてみました.

Revision

Option Explicit

Sub Revision()
    Dim myDoc   As Document
    Set myDoc = ActiveDocument
    With myDoc
        .TrackRevisions = True  '変更履歴開始
        .TrackMoves = True      '移動を記録する
        .TrackFormatting = True '書式の変更を記録する
    End With
    With Options
        '挿入された箇所'
        .InsertedTextMark = wdInsertedTextMarkBold
        .InsertedTextMark = wdInsertedTextMarkColorOnly
        .InsertedTextMark = wdInsertedTextMarkDoubleStrikeThrough
        .InsertedTextMark = wdInsertedTextMarkDoubleUnderline
        .InsertedTextMark = wdInsertedTextMarkItalic
        .InsertedTextMark = wdInsertedTextMarkNone
        .InsertedTextMark = wdInsertedTextMarkStrikeThrough
        .InsertedTextMark = wdInsertedTextMarkUnderline
        '(挿入された箇所の)色'
        .InsertedTextColor = wdAuto         '自動'
        .InsertedTextColor = wdBlack        '黒'
        .InsertedTextColor = wdBlue         '青'
        .InsertedTextColor = wdBrightGreen  '明るい緑'
        .InsertedTextColor = wdByAuthor     '校閲者別'
        .InsertedTextColor = wdDarkBlue     '濃い青'
        .InsertedTextColor = wdDarkRed      '濃い赤'
        .InsertedTextColor = wdDarkYellow   '濃い黄'
        .InsertedTextColor = wdGray25       '25% 灰色'
        .InsertedTextColor = wdGray50       '50% 灰色'
        .InsertedTextColor = wdGreen        '緑'
        .InsertedTextColor = wdNoHighlight  '(なし)'
        .InsertedTextColor = wdPink         'ピンク'
        .InsertedTextColor = wdRed          '赤'
        .InsertedTextColor = wdTeal         '青緑'
        .InsertedTextColor = wdTurquoise    '水色'
        .InsertedTextColor = wdViolet       '紫'
        .InsertedTextColor = wdWhite        '白'
        .InsertedTextColor = wdYellow       '黄'
        '削除された箇所'
        .DeletedTextMark = wdDeletedTextMarkBold                '太字'
        .DeletedTextMark = wdDeletedTextMarkCaret               '^(キャレット)'
        .DeletedTextMark = wdDeletedTextMarkColorOnly           '色のみ'
        .DeletedTextMark = wdDeletedTextMarkDoubleStrikeThrough '二重取り消し線'
        .DeletedTextMark = wdDeletedTextMarkDoubleUnderline     '二重下線'
        .DeletedTextMark = wdDeletedTextMarkHidden              '隠し文字'
        .DeletedTextMark = wdDeletedTextMarkItalic              '斜体'
        .DeletedTextMark = wdDeletedTextMarkNone                '(なし)'
        .DeletedTextMark = wdDeletedTextMarkPound               '#(パウンド)'
        .DeletedTextMark = wdDeletedTextMarkStrikeThrough       '取り消し線'
        .DeletedTextMark = wdDeletedTextMarkUnderline           '下線'
        '(削除された箇所の)色'
        .DeletedTextColor = wdAuto
        .DeletedTextColor = wdBlack
        .DeletedTextColor = wdBlue
        .DeletedTextColor = wdBrightGreen
        .DeletedTextColor = wdByAuthor
        .DeletedTextColor = wdDarkBlue
        .DeletedTextColor = wdDarkRed
        .DeletedTextColor = wdDarkYellow
        .DeletedTextColor = wdGray25
        .DeletedTextColor = wdGray50
        .DeletedTextColor = wdGreen
        .DeletedTextColor = wdNoHighlight
        .DeletedTextColor = wdPink
        .DeletedTextColor = wdRed
        .DeletedTextColor = wdTeal
        .DeletedTextColor = wdTurquoise
        .DeletedTextColor = wdViolet
        .DeletedTextColor = wdWhite
        .DeletedTextColor = wdYellow
        '変更された行'
        .RevisedLinesMark = wdRevisedLinesMarkLeftBorder    '左罫線'
        .RevisedLinesMark = wdRevisedLinesMarkNone          '(なし)'
        .RevisedLinesMark = wdRevisedLinesMarkOutsideBorder '外枠'
        .RevisedLinesMark = wdRevisedLinesMarkRightBorder   '右罫線'
        '(変更された行の)色'
        .RevisedLinesColor = wdAuto
        .RevisedLinesColor = wdBlack
        .RevisedLinesColor = wdBlue
        .RevisedLinesColor = wdBrightGreen
        .RevisedLinesColor = wdByAuthor
        .RevisedLinesColor = wdDarkBlue
        .RevisedLinesColor = wdDarkRed
        .RevisedLinesColor = wdDarkYellow
        .RevisedLinesColor = wdGray25
        .RevisedLinesColor = wdGray50
        .RevisedLinesColor = wdGreen
        .RevisedLinesColor = wdNoHighlight
        .RevisedLinesColor = wdPink
        .RevisedLinesColor = wdRed
        .RevisedLinesColor = wdTeal
        .RevisedLinesColor = wdTurquoise
        .RevisedLinesColor = wdViolet
        .RevisedLinesColor = wdWhite
        .RevisedLinesColor = wdYellow
        'コメントの色'
        .CommentsColor = wdAuto
        .CommentsColor = wdBlack
        .CommentsColor = wdBlue
        .CommentsColor = wdBrightGreen
        .CommentsColor = wdByAuthor
        .CommentsColor = wdDarkBlue
        .CommentsColor = wdDarkRed
        .CommentsColor = wdDarkYellow
        .CommentsColor = wdGray25
        .CommentsColor = wdGray50
        .CommentsColor = wdGreen
        .CommentsColor = wdNoHighlight
        .CommentsColor = wdPink
        .CommentsColor = wdRed
        .CommentsColor = wdTeal
        .CommentsColor = wdTurquoise
        .CommentsColor = wdViolet
        .CommentsColor = wdWhite
        .CommentsColor = wdYellow
        '移動前'
        .MoveFromTextMark = wdMoveFromTextMarkBold
        .MoveFromTextMark = wdMoveFromTextMarkCaret
        .MoveFromTextMark = wdMoveFromTextMarkColorOnly
        .MoveFromTextMark = wdMoveFromTextMarkDoubleStrikeThrough
        .MoveFromTextMark = wdMoveFromTextMarkDoubleUnderline
        .MoveFromTextMark = wdMoveFromTextMarkHidden
        .MoveFromTextMark = wdMoveFromTextMarkItalic
        .MoveFromTextMark = wdMoveFromTextMarkNone
        .MoveFromTextMark = wdMoveFromTextMarkPound
        .MoveFromTextMark = wdMoveFromTextMarkStrikeThrough
        .MoveFromTextMark = wdMoveFromTextMarkUnderline
        '(移動前の)色'
        .MoveFromTextColor = wdAuto
        .MoveFromTextColor = wdBlack
        .MoveFromTextColor = wdBlue
        .MoveFromTextColor = wdBrightGreen
        .MoveFromTextColor = wdByAuthor
        .MoveFromTextColor = wdDarkBlue
        .MoveFromTextColor = wdDarkRed
        .MoveFromTextColor = wdDarkYellow
        .MoveFromTextColor = wdGray25
        .MoveFromTextColor = wdGray50
        .MoveFromTextColor = wdGreen
        .MoveFromTextColor = wdNoHighlight
        .MoveFromTextColor = wdPink
        .MoveFromTextColor = wdRed
        .MoveFromTextColor = wdTeal
        .MoveFromTextColor = wdTurquoise
        .MoveFromTextColor = wdViolet
        .MoveFromTextColor = wdWhite
        .MoveFromTextColor = wdYellow
        '移動後'
        .MoveToTextMark = wdMoveToTextMarkBold
        .MoveToTextMark = wdMoveToTextMarkColorOnly
        .MoveToTextMark = wdMoveToTextMarkDoubleStrikeThrough
        .MoveToTextMark = wdMoveToTextMarkDoubleUnderline
        .MoveToTextMark = wdMoveToTextMarkItalic
        .MoveToTextMark = wdMoveToTextMarkNone
        .MoveToTextMark = wdMoveToTextMarkStrikeThrough
        .MoveToTextMark = wdMoveToTextMarkUnderline
        '(移動後の)色'
        .MoveToTextColor = wdAuto
        .MoveToTextColor = wdBlack
        .MoveToTextColor = wdBlue
        .MoveToTextColor = wdBrightGreen
        .MoveToTextColor = wdByAuthor
        .MoveToTextColor = wdDarkBlue
        .MoveToTextColor = wdDarkRed
        .MoveToTextColor = wdDarkYellow
        .MoveToTextColor = wdGray25
        .MoveToTextColor = wdGray50
        .MoveToTextColor = wdGreen
        .MoveToTextColor = wdNoHighlight
        .MoveToTextColor = wdPink
        .MoveToTextColor = wdRed
        .MoveToTextColor = wdTeal
        .MoveToTextColor = wdTurquoise
        .MoveToTextColor = wdViolet
        .MoveToTextColor = wdWhite
        .MoveToTextColor = wdYellow
        '挿入されたセル'
        .InsertedCellColor = wdCellColorByAuthor    '校閲者別'
        .InsertedCellColor = wdCellColorLightBlue   '薄い青'
        .InsertedCellColor = wdCellColorLightGray   '薄い灰色'
        .InsertedCellColor = wdCellColorLightGreen  '薄い緑'
        .InsertedCellColor = wdCellColorLightOrange '薄いオレンジ'
        .InsertedCellColor = wdCellColorLightPurple '薄い紫'
        .InsertedCellColor = wdCellColorLightYellow '薄い黄'
        .InsertedCellColor = wdCellColorNoHighlight '(なし)'
        .InsertedCellColor = wdCellColorPink        '薄いピンク'
        '結合されたセル'
        .MergedCellColor = wdCellColorByAuthor
        .MergedCellColor = wdCellColorLightBlue
        .MergedCellColor = wdCellColorLightGray
        .MergedCellColor = wdCellColorLightGreen
        .MergedCellColor = wdCellColorLightOrange
        .MergedCellColor = wdCellColorLightPurple
        .MergedCellColor = wdCellColorLightYellow
        .MergedCellColor = wdCellColorNoHighlight
        .MergedCellColor = wdCellColorPink
        '削除されたセル'
        .DeletedCellColor = wdCellColorByAuthor
        .DeletedCellColor = wdCellColorLightBlue
        .DeletedCellColor = wdCellColorLightGray
        .DeletedCellColor = wdCellColorLightGreen
        .DeletedCellColor = wdCellColorLightOrange
        .DeletedCellColor = wdCellColorLightPurple
        .DeletedCellColor = wdCellColorLightYellow
        .DeletedCellColor = wdCellColorNoHighlight
        .DeletedCellColor = wdCellColorPink
        '分割されたセル'
        .SplitCellColor = wdCellColorByAuthor
        .SplitCellColor = wdCellColorLightBlue
        .SplitCellColor = wdCellColorLightGray
        .SplitCellColor = wdCellColorLightGreen
        .SplitCellColor = wdCellColorLightOrange
        .SplitCellColor = wdCellColorLightPurple
        .SplitCellColor = wdCellColorLightYellow
        .SplitCellColor = wdCellColorNoHighlight
        .SplitCellColor = wdCellColorPink
        '書式が変更された箇所'
        .RevisedPropertiesMark = wdRevisedPropertiesMarkBold                '太字'
        .RevisedPropertiesMark = wdRevisedPropertiesMarkColorOnly           '色のみ'
        .RevisedPropertiesMark = wdRevisedPropertiesMarkDoubleStrikeThrough '二重取り消し線'
        .RevisedPropertiesMark = wdRevisedPropertiesMarkDoubleUnderline     '二重下線'
        .RevisedPropertiesMark = wdRevisedPropertiesMarkItalic              '斜体'
        .RevisedPropertiesMark = wdRevisedPropertiesMarkNone                '(なし)'
        .RevisedPropertiesMark = wdRevisedPropertiesMarkStrikeThrough       '取り消し線'
        .RevisedPropertiesMark = wdRevisedPropertiesMarkUnderline           '下線'
        '(書式が変更された)色'
        .RevisedPropertiesColor = wdAuto
        .RevisedPropertiesColor = wdBlack
        .RevisedPropertiesColor = wdBlue
        .RevisedPropertiesColor = wdBrightGreen
        .RevisedPropertiesColor = wdByAuthor
        .RevisedPropertiesColor = wdDarkBlue
        .RevisedPropertiesColor = wdDarkRed
        .RevisedPropertiesColor = wdDarkYellow
        .RevisedPropertiesColor = wdGray25
        .RevisedPropertiesColor = wdGray50
        .RevisedPropertiesColor = wdGreen
        .RevisedPropertiesColor = wdNoHighlight
        .RevisedPropertiesColor = wdPink
        .RevisedPropertiesColor = wdRed
        .RevisedPropertiesColor = wdTeal
        .RevisedPropertiesColor = wdTurquoise
        .RevisedPropertiesColor = wdViolet
        .RevisedPropertiesColor = wdWhite
        .RevisedPropertiesColor = wdYellow
        '印刷するときの用紙の向き'
        .RevisionsBalloonPrintOrientation = wdBalloonPrintOrientationAuto           '自動'
        .RevisionsBalloonPrintOrientation = wdBalloonPrintOrientationForceLandscape '常に横向き'
        .RevisionsBalloonPrintOrientation = wdBalloonPrintOrientationPreserve       '変更しない'
    End With
    
    With ActiveWindow.View
        '印刷およびWebレイアウト表示での吹き出しの仕様'
        .RevisionsMode = wdBalloonRevisions     '使用しない'
        .RevisionsMode = wdInLineRevisions      '常に使用する'
        .RevisionsMode = wdMixedRevisions       'コメント/書式にのみ使用'
        '文字列からの引き出し線を表示する'
        .RevisionsBalloonShowConnectingLines = False
        .RevisionsBalloonShowConnectingLines = True
        '余白'
        .RevisionsBalloonSide = wdLeftMargin    '左余白'
        .RevisionsBalloonSide = wdRightMargin   '右余白'
        '基準'
        .RevisionsBalloonWidthType = wdBalloonWidthPoints   'ミリメートル(mm)'
        .RevisionsBalloonWidthType = wdBalloonWidthPercent  'パーセント(%)'
        '吹き出し線の幅'
        .RevisionsBalloonWidth = MillimetersToPoints(76.2)
        .RevisionsBalloonWidth = 36
    End With
End Sub
Pocket

投稿者: admin

趣味:写真撮影とデータベース. カメラ:TOYO FIELD, Hasselblad 500C/M, Leica M6. SQL Server 2008 R2, MySQL, Microsoft Access.

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です