Results 1 to 6 of 6

Thread: Setting contact to appointment / journal item

  1. #1

    Thread Starter
    Addicted Member Beengie's Avatar
    Join Date
    Nov 2003
    Location
    Central Valley, CA
    Posts
    243

    Setting contact to appointment / journal item

    How do you set contacts for appointments and journal items?
    BeengieHappy.Vaue = (SharksScore > OpponentsScore)

    Go Sharks!

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Setting contact to appointment / journal item

    You need to add a contact as a receipient of the appointment item.
    VB Code:
    1. oApptItem.Recipients.Add ("RobDog888")
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Addicted Member Beengie's Avatar
    Join Date
    Nov 2003
    Location
    Central Valley, CA
    Posts
    243

    Re: Setting contact to appointment / journal item

    do I need to create a recipient object?

    BTW I am doing this with VBA
    I am not sure if I am on the right track. I am confused when it comes to the "recipients" collection and "recipient" object when it relates to a journal item.

    I tried to create a recipient object and add it to the journal item, but it did not work. The contacts field was empty when I opened the item in the Outlook UI.

    VB Code:
    1. Private Sub CreateJournalItem()
    2.  
    3. Dim objappitm As Outlook.JournalItem
    4. Dim objRecip As Outlook.Recipient
    5.  
    6. Set objappitm = Outlook.CreateItem(olJournalItem)
    7. Set objRecip = objappitm.Recipients.Add(cboContact.text)
    8.  
    9. objappitm.Companies = "Acme"
    10. objappitm.Subject = txtSubject.Text
    11. objappitm.Type = "Phone Call" & " (reveived)"
    12. objappitm.Start = txtDate.Text & " " & txtTime.Text
    13. objappitm.Duration = 30
    14.  
    15. objappitm.Recipients.Add objRecip
    16.  
    17. objappitm.Save
    18.  
    19. End Sub

    what's wrong with this code?

    thanks for the help
    BeengieHappy.Vaue = (SharksScore > OpponentsScore)

    Go Sharks!

  4. #4

    Thread Starter
    Addicted Member Beengie's Avatar
    Join Date
    Nov 2003
    Location
    Central Valley, CA
    Posts
    243

    Re: Setting contact to appointment / journal item

    I tried what you posted, but there is nothing in the contacts field for any example I try.
    BeengieHappy.Vaue = (SharksScore > OpponentsScore)

    Go Sharks!

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Setting contact to appointment / journal item

    For the ContactItem you also need to do a .Recipients.ResolveAll
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    Addicted Member Beengie's Avatar
    Join Date
    Nov 2003
    Location
    Central Valley, CA
    Posts
    243

    Re: Setting contact to appointment / journal item

    Contact item?
    BeengieHappy.Vaue = (SharksScore > OpponentsScore)

    Go Sharks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width