メモ

Outlook2010


表示名、メールアドレス で表示する


ユーザーフォームでリストボックスで表示する場合

Private Sub UserForm_Initialize()

Set cITEM = Application.ActiveExplorer.Selection.Item(1)

With ListBox1
  .AddItem ""
  .List(0, 0) = "■■ 表示名 ■■"
  .List(0, 1) = "■■ メールアドレス ■■"
  .AddItem ""
  .List(1, 0) = "From ■■ " & cITEM.Sender
  .List(1, 1) = cITEM.SenderEmailAddress

  For Each recip In cITEM.Recipients
   .AddItem ""
   .List(.ListCount - 1, 0) = recip.Name
   .List(.ListCount - 1, 1) = recip.Address
  Next
End With

End Sub

Sub RecipMember()
 
 UserForm1.Show

End Sub



とりあえずMsgboxで表示させる場合

Sub RecipMember()
Set cITEM = Application.ActiveExplorer.Selection.Item(1)

With cITEM
 m = "【差】" & .Sender & Chr(9) & .SenderEmailAddress & vbCrLf
 For Each recip In cITEM.Recipients
  m = m & recip.Name & Chr(9) & recip.Address & vbCrLf
 Next
End With
End Sub




VBA Editorの起動方法: Alt + F11




ツールバーへボタンを登録する方法

リボン(ツールバー)を右クリック
リボンのユーザー設定(R)...を選択
新しいグループを作成(ホーム(メール)などに)
作成したグループをハイライトした状態で左上のコマンドの選択(C)からマクロを選択
作成したマクロを選択し 追加(A)>> ボタンを押す