Solved

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

Posted on 2006-06-10
1
173 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
ID: 16877455
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

773 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