Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-06-10
1
Medium Priority
?
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses

705 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