VB
Sub CopyCurrentContact()
Dim OutlookObj As Object
Dim InspectorObj As Object
Dim ItemObj As Object
Set OutlookObj = CreateObject("Outlook.Application")
Set InspectorObj = OutlookObj.ActiveInspector
Set ItemObj = InspectorObj.CurrentItem
Application.ActiveDocument.Range.InsertAfter (ItemObj.FullName & " from " & ItemObj.CompanyName)
End Sub
このコードでは、現在 Outlook で開いている連絡先を、Word で開いている文書にコピーします。 このコードを正常に実行するには、連絡先が Outlook で開かれ、閲覧できる状態になっている必要があります。

コメント