Skip to content

Instantly share code, notes, and snippets.

@yamatetsu0111
Last active August 7, 2020 12:40
Show Gist options
  • Save yamatetsu0111/9e4be4ef3bb5222c8f3058790e45a218 to your computer and use it in GitHub Desktop.
Save yamatetsu0111/9e4be4ef3bb5222c8f3058790e45a218 to your computer and use it in GitHub Desktop.
誰でもExcelVBAでOutlookを呼び出すことができるコード(参照設定済みの場合)
Option Explicit
Sub メール作成()
'メール作成時のおまじない
'Outlookアプリケーションオブジェクトの取得
Dim MyOutlook As Outlook.Application
Set MyOutlook = New Outlook.Application
'メールitemオブジェクトの取得
Dim Mailitem As Outlook.Mailitem
Set Mailitem = MyOutlook.CreateItem(olMailItem)
'メールの表示
Mailitem.Display
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment