LoginSignup
0
0

More than 1 year has passed since last update.

赤文字検索ダイアログを表示するWordVBAの作成+アドイン化

Posted at

WordVBAの作成

Wordの新規作成からVisual Basicを開き、以下のコマンドを張り付ける

Module1
Sub my_addin()
  Selection.Find.ClearFormatting
  Selection.Find.Font.Color = wdColorRed

  With Selection.Find
    .Text = ""
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False  
    .MatchWholeWord = False
    .MatchByte = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = False
    .MatchFuzzy = True
  End With

  Application.CommandBars.FindControl(ID:=141).Execute
End Sub

アドイン化

Wordファイルをマクロテンプレート(*.dotm)形式で保存任意のフォルダに保存する
Wordメニューの[ファイル]→[オプション]→[詳細設定]→[全般]から[スタートアップ]を確認する
保存任意のフォルダに作成したテンプレートファイルをスタートアップに格納する

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0