Solved

Add contact name, phone, and address to subject when scheduling appointment

Posted on 2006-06-10
1
171 Views
Last Modified: 2010-04-07
Hello,

I am using the below code to Add contact name, phone, and address to subject when scheduling appointments outlook.  Would some please tell me how to put spaces or dases between each of the entries?




Sub MakeAppointment()
    Dim olkAppointment As Outlook.AppointmentItem, _
        olkContact As Outlook.ContactItem
    Set olkContact = Application.ActiveExplorer.Selection.Item(1)
    Set olkAppointment = Application.CreateItem(olAppointmentItem)
    olkAppointment.Location = olkContact.BusinessAddressCity
    olkAppointment.Subject = olkContact.HomeTelephoneNumber & olkContact.BusinessTelephoneNumber & olkContact.FullName & olkContact.HomeAddress & (olkContact.BusinessAddress)
    olkAppointment.Links.Add olkContact
    olkAppointment.Display
    Set olkContact = Nothing
End Sub
0
Comment
Question by:agrafixx
1 Comment
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
Comment Utility
Hi agrafixx,

Try this...

Sub MakeAppointment()
    Dim olkAppointment As Outlook.AppointmentItem, _
        olkContact As Outlook.ContactItem
    Set olkContact = Application.ActiveExplorer.Selection.Item(1)
    Set olkAppointment = Application.CreateItem(olAppointmentItem)
    olkAppointment.Location = olkContact.BusinessAddressCity
    olkAppointment.Subject = olkContact.HomeTelephoneNumber & "-" & olkContact.BusinessTelephoneNumber & _
                    "-" & olkContact.FullName & "-" & olkContact.HomeAddress & "-" & (olkContact.BusinessAddress)
    olkAppointment.Links.Add olkContact
    olkAppointment.Display
    Set olkContact = Nothing
End Sub

Regards,

Wayne
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now