A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Required and oprtional attendees



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 4th 10, 11:32 AM posted to microsoft.public.outlook.program_vba
JP Ronse
external usenet poster
 
Posts: 19
Default Required and oprtional attendees

Hi All,

I am creating meetingrequests with Excel VBA. Part of the code below.

Set gobjOutlook = GetObject(, "Outlook.application")

Set gobjAppointment = gobjOutlook.CreateItem(olAppointmentItem)

With gobjAppointment

.MeetingStatus = olMeeting

... and all other stuff

Set gobjMailAddress = .Recipients.Add(gstrAddressee)

gobjMailAddress.Type = olOptional

Set gobjMailAddress = .Recipients.Add(gstrOptionalAddressee)

gobjMailAddress.Type = olOptional

End With

Sometimes the optional addressee becomes a required one and sometimes they
remain optional.

I'm not sure why this happen but think that it has something to do with the
way I specify the optional attendees.

- looks as working always correctly

- John Doe works also correctly when known in my addressbook

- I goes from time to time wrong when John Doe is known in the addressbook
as John Doe (Outlook Forum)

Can soemone confirm this or tell me more about this? Thanks in advance.



With kind regards,



JP






Ads
  #2  
Old April 5th 10, 03:42 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Required and oprtional attendees

If you supply a name instead of an email address and the name can be
ambiguous or doesn't match what's in an address book the recipient may not
resolve. That shouldn't change the recipient type.

See if this works better. Here is the equivalent of each type of meeting
recipient versus the recipient type:

Required To
Optional Cc
Resource Bcc

Set those and see if things work better, but avoid ambiguous recipients.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JP Ronse" wrote in message
...
Hi All,

I am creating meetingrequests with Excel VBA. Part of the code below.

Set gobjOutlook = GetObject(, "Outlook.application")

Set gobjAppointment = gobjOutlook.CreateItem(olAppointmentItem)

With gobjAppointment

.MeetingStatus = olMeeting

... and all other stuff

Set gobjMailAddress = .Recipients.Add(gstrAddressee)

gobjMailAddress.Type = olOptional

Set gobjMailAddress = .Recipients.Add(gstrOptionalAddressee)

gobjMailAddress.Type = olOptional

End With

Sometimes the optional addressee becomes a required one and sometimes they
remain optional.

I'm not sure why this happen but think that it has something to do with
the way I specify the optional attendees.

- looks as working always correctly

- John Doe works also correctly when known in my addressbook

- I goes from time to time wrong when John Doe is known in the addressbook
as John Doe (Outlook Forum)

Can soemone confirm this or tell me more about this? Thanks in advance.



With kind regards,



JP







  #3  
Old April 6th 10, 10:36 AM posted to microsoft.public.outlook.program_vba
JP Ronse
external usenet poster
 
Posts: 19
Default Required and oprtional attendees

Hi Ken,

I've tried your suggestion and it looks indeed better. Thanks for this.

With kind regards,

JP


"Ken Slovak - [MVP - Outlook]" wrote in message
...
If you supply a name instead of an email address and the name can be
ambiguous or doesn't match what's in an address book the recipient may not
resolve. That shouldn't change the recipient type.

See if this works better. Here is the equivalent of each type of meeting
recipient versus the recipient type:

Required To
Optional Cc
Resource Bcc

Set those and see if things work better, but avoid ambiguous recipients.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JP Ronse" wrote in message
...
Hi All,

I am creating meetingrequests with Excel VBA. Part of the code below.

Set gobjOutlook = GetObject(, "Outlook.application")

Set gobjAppointment = gobjOutlook.CreateItem(olAppointmentItem)

With gobjAppointment

.MeetingStatus = olMeeting

... and all other stuff

Set gobjMailAddress = .Recipients.Add(gstrAddressee)

gobjMailAddress.Type = olOptional

Set gobjMailAddress = .Recipients.Add(gstrOptionalAddressee)

gobjMailAddress.Type = olOptional

End With

Sometimes the optional addressee becomes a required one and sometimes
they remain optional.

I'm not sure why this happen but think that it has something to do with
the way I specify the optional attendees.

- looks as working always correctly

- John Doe works also correctly when known in my addressbook

- I goes from time to time wrong when John Doe is known in the
addressbook as John Doe (Outlook Forum)

Can soemone confirm this or tell me more about this? Thanks in advance.



With kind regards,



JP









  #4  
Old February 3rd 14, 10:34 PM
4Runner 4Runner is offline
Junior Member
 
First recorded activity at Outlookbanter: Feb 2014
Posts: 3
Default

I know the previous post was a few years ago, but I am having the exact same problem, and I have already tried using olCC instead of olOptional when setting the .Type.


I add the recipients and set the type in a subroutine, called for each recipient in the list. Going through the debugger, I can see it set the type and create the correct OptionalAttendee string in the Appt object when it first comes back to the calling routine. However, as soon as I click to continue to the next line in the code, the OptionalAttendee string goes empty ("") and the items move to the RequiredAttendee string. However, if I look at the .Recipients object, the corresponding Recipient.Item.Type still shows as 2.

From the outer routine:

Dim olReqAttendee, olOptAttendee, olResAttendee As Outlook.Recipient
.
.
.
If Len(sOptAttendee) 0 Then
AddAttendees olApt, sOptAttendee, olOptAttendee, olCC
End If

In the AddAttendees subroutine:
Sub AddAttendess(olObj As Object, sAttendee As String, thisAttendee As Variant, Optional olType As Variant)

Dim arrRecipients As Variant
Dim i As Integer
Dim iLB, iUB As Integer

arrRecipients = SplitRecipients(sAttendee)

iLB = LBound(arrRecipients)
iUB = UBound(arrRecipients)

For i = iLB To iUB
Set thisAttendee = olObj.recipients.Add(arrRecipients(i))
If Not IsMissing(olType) Then thisAttendee.Type = olType
Next i

End Sub

And not to leave anything out, this is the SplitRecipients function:

Function SplitRecipients(strRecipients As Variant, Optional iLB As Integer = 0) As String()

Dim sTemp As String
Dim sArr() As String
Dim i, iUB As Integer

sTemp = Replace(strRecipients, ",", ";")
sTemp = Replace(sTemp, vbLf, ";")

sArr = Split(sTemp, ";")

iUB = UBound(sArr)
i = LBound(sArr)

While i = iUB
sArr(i) = Trim(sArr(i))
If Len(sArr(i)) = 0 Then
DeleteFromArray sArr, i
iUB = iUB - 1
Else
i = i + 1
End If
Wend

SplitRecipients = sArr

End Function

Any ideas?

Thanks!

Quote:
Originally Posted by JP Ronse View Post
Hi Ken,

I've tried your suggestion and it looks indeed better. Thanks for this.

With kind regards,

JP


"Ken Slovak - [MVP - Outlook]" wrote in message
...
If you supply a name instead of an email address and the name can be
ambiguous or doesn't match what's in an address book the recipient may not
resolve. That shouldn't change the recipient type.

See if this works better. Here is the equivalent of each type of meeting
recipient versus the recipient type:

Required To
Optional Cc
Resource Bcc

Set those and see if things work better, but avoid ambiguous recipients.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"JP Ronse" wrote in message
...
Hi All,

I am creating meetingrequests with Excel VBA. Part of the code below.

Set gobjOutlook = GetObject(, "Outlook.application")

Set gobjAppointment = gobjOutlook.CreateItem(olAppointmentItem)

With gobjAppointment

.MeetingStatus = olMeeting

... and all other stuff

Set gobjMailAddress = .Recipients.Add(gstrAddressee)

gobjMailAddress.Type = olOptional

Set gobjMailAddress = .Recipients.Add(gstrOptionalAddressee)

gobjMailAddress.Type = olOptional

End With

Sometimes the optional addressee becomes a required one and sometimes
they remain optional.

I'm not sure why this happen but think that it has something to do with
the way I specify the optional attendees.

-
looks as working always correctly

- John Doe works also correctly when known in my addressbook

- I goes from time to time wrong when John Doe is known in the
addressbook as John Doe (Outlook Forum)

Can soemone confirm this or tell me more about this? Thanks in advance.



With kind regards,



JP






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook- importing required attendees Shana Hunt Outlook - Calandaring 2 January 6th 09 10:58 AM
Reminding required attendees to respond Rosie Outlook - Calandaring 0 February 8th 08 06:59 PM
Required Attendees autocomplete G-ME Outlook - Using Forms 1 February 6th 08 01:30 PM
required attendees appear as optional [email protected] Outlook - Calandaring 0 October 26th 07 08:53 AM
Required Attendees not show up Zenith Outlook - Calandaring 0 December 1st 06 04:10 AM


All times are GMT +1. The time now is 02:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.