insert v card command?

S

Sam Raymond

Hi,

I would like to create a button on my toolbar that will attach a vcard to my
e-mail when I choose to attach it.

There is a stationary setting that allows you to do this for every e-mail,
but I don't want to send it to everyone. Just want to attach when I feel
it's convenient.

I look forward to hearing from you all.

Regards,

Sam
 
S

Sue Mosher [MVP-Outlook]

VBA macro code to insert a vCard would look something like this:

Sub InsertVCard()
Dim strPath as String
Dim objItem as Object
On Error Resume Next

strPath = "C:\myvcard.vcf" ' <=== you set the path here
Set objItem = Application.ActiveInspector.CurrentItem
If Not objItem Is Nothing Then
If objItem.Class = olMail Then
objItem.Attachments.Add strPath
End If
End If

Set objItem = Nothing
End Sub

You could also just create multiple signatures with and without the vCard
and use those

FYI, there is a newsgroup specifically for macros and other general Outlook
programming issues "down the hall" at microsoft.public.outlook.program_vba
or, via web interface, at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba
 
Top