![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am using Microsoft Office 2007 to create Outlook calendar appointments from
Access. I can successfully do this with one exception: I have a series of calendars with similar names - the last portion of the name, for the 16 calendars, ranges from SEMI-1 to SEMI-16. With the code below, the .Resolve method is unsuccessful for only the calendar ...SEMI-1. I have verified that the name correctly matches the name of the calendar. Any suggestions would be appreciated (including renaming that calendar, if necessary!) Dim objOutlook As Outlook.Application Dim objNameSpace As Outlook.NameSpace Dim objRecipient As Outlook.Recipient Dim objFolder As Outlook.MAPIFolder Dim objItems As Outlook.Items Dim objAppt As Outlook.AppointmentItem Dim myCalendar, strStart, strShortTime As String 'find and delete the corresponding calendar appointment Set objOutlook = CreateObject("Outlook.Application") Set objNameSpace = objOutlook.GetNamespace("MAPI") If Len(Trim(Nz(Me!cboCalendar.Column(0)))) 0 Then ' proceed, should be an appointment myCalendar = strCalendar Set objRecipient = objNameSpace.CreateRecipient(myCalendar) ' check calendar name objRecipient.Resolve If objRecipient.Resolved Then ' create start date/time strStart = strExamDate & " " & strStartTime strStart = Format(strExamDate & " " & strStartTime, "mm/dd/yyyy hh:mm AMPM") ' set values for objects and delete appointment Set objFolder = objNameSpace.GetSharedDefaultFolder(objRecipient, olFolderCalendar) Set objItems = objFolder.Items Set objAppt = objItems.Find("[Start] = """ & strStart & """") If objAppt Is Nothing Then MsgBox ("This appointment was not found in Outlook") Else objAppt.Delete Set objAppt = Nothing 'Now display appropriate message MsgBox ("Appointment deleted from Outlook") End If Set objItems = Nothing Set objFolder = Nothing Else MsgBox ("No appointment deleted, could not resolve calendar name") End If Else MsgBox ("No appointment deleted, no existing appointment") End If 'Release the object variables Set objNameSpace = Nothing Set objRecipient = Nothing Set objOutlook = Nothing |
Ads |
#2
|
|||
|
|||
![]()
Try prefixing each one with "=" to force Outlook to perform an exact match
on the name when it tries to resolve. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "JoD" wrote in message ... I am using Microsoft Office 2007 to create Outlook calendar appointments from Access. I can successfully do this with one exception: I have a series of calendars with similar names - the last portion of the name, for the 16 calendars, ranges from SEMI-1 to SEMI-16. With the code below, the .Resolve method is unsuccessful for only the calendar ...SEMI-1. I have verified that the name correctly matches the name of the calendar. Any suggestions would be appreciated (including renaming that calendar, if necessary!) Dim objOutlook As Outlook.Application Dim objNameSpace As Outlook.NameSpace Dim objRecipient As Outlook.Recipient Dim objFolder As Outlook.MAPIFolder Dim objItems As Outlook.Items Dim objAppt As Outlook.AppointmentItem Dim myCalendar, strStart, strShortTime As String 'find and delete the corresponding calendar appointment Set objOutlook = CreateObject("Outlook.Application") Set objNameSpace = objOutlook.GetNamespace("MAPI") If Len(Trim(Nz(Me!cboCalendar.Column(0)))) 0 Then ' proceed, should be an appointment myCalendar = strCalendar Set objRecipient = objNameSpace.CreateRecipient(myCalendar) ' check calendar name objRecipient.Resolve If objRecipient.Resolved Then ' create start date/time strStart = strExamDate & " " & strStartTime strStart = Format(strExamDate & " " & strStartTime, "mm/dd/yyyy hh:mm AMPM") ' set values for objects and delete appointment Set objFolder = objNameSpace.GetSharedDefaultFolder(objRecipient, olFolderCalendar) Set objItems = objFolder.Items Set objAppt = objItems.Find("[Start] = """ & strStart & """") If objAppt Is Nothing Then MsgBox ("This appointment was not found in Outlook") Else objAppt.Delete Set objAppt = Nothing 'Now display appropriate message MsgBox ("Appointment deleted from Outlook") End If Set objItems = Nothing Set objFolder = Nothing Else MsgBox ("No appointment deleted, could not resolve calendar name") End If Else MsgBox ("No appointment deleted, no existing appointment") End If 'Release the object variables Set objNameSpace = Nothing Set objRecipient = Nothing Set objOutlook = Nothing |
#3
|
|||
|
|||
![]()
Could you kindly show me an example of what you mean? I'm not sure where the
"=" would go. Thanks! "Sue Mosher [MVP]" wrote: Try prefixing each one with "=" to force Outlook to perform an exact match on the name when it tries to resolve. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "JoD" wrote in message ... I am using Microsoft Office 2007 to create Outlook calendar appointments from Access. I can successfully do this with one exception: I have a series of calendars with similar names - the last portion of the name, for the 16 calendars, ranges from SEMI-1 to SEMI-16. With the code below, the .Resolve method is unsuccessful for only the calendar ...SEMI-1. I have verified that the name correctly matches the name of the calendar. Any suggestions would be appreciated (including renaming that calendar, if necessary!) Dim objOutlook As Outlook.Application Dim objNameSpace As Outlook.NameSpace Dim objRecipient As Outlook.Recipient Dim objFolder As Outlook.MAPIFolder Dim objItems As Outlook.Items Dim objAppt As Outlook.AppointmentItem Dim myCalendar, strStart, strShortTime As String 'find and delete the corresponding calendar appointment Set objOutlook = CreateObject("Outlook.Application") Set objNameSpace = objOutlook.GetNamespace("MAPI") If Len(Trim(Nz(Me!cboCalendar.Column(0)))) 0 Then ' proceed, should be an appointment myCalendar = strCalendar Set objRecipient = objNameSpace.CreateRecipient(myCalendar) ' check calendar name objRecipient.Resolve If objRecipient.Resolved Then ' create start date/time strStart = strExamDate & " " & strStartTime strStart = Format(strExamDate & " " & strStartTime, "mm/dd/yyyy hh:mm AMPM") ' set values for objects and delete appointment Set objFolder = objNameSpace.GetSharedDefaultFolder(objRecipient, olFolderCalendar) Set objItems = objFolder.Items Set objAppt = objItems.Find("[Start] = """ & strStart & """") If objAppt Is Nothing Then MsgBox ("This appointment was not found in Outlook") Else objAppt.Delete Set objAppt = Nothing 'Now display appropriate message MsgBox ("Appointment deleted from Outlook") End If Set objItems = Nothing Set objFolder = Nothing Else MsgBox ("No appointment deleted, could not resolve calendar name") End If Else MsgBox ("No appointment deleted, no existing appointment") End If 'Release the object variables Set objNameSpace = Nothing Set objRecipient = Nothing Set objOutlook = Nothing |
#4
|
|||
|
|||
![]()
Set objRecipient = objNameSpace.CreateRecipient("=" & myCalendar)
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "JoD" wrote in message ... Could you kindly show me an example of what you mean? I'm not sure where the "=" would go. Thanks! "Sue Mosher [MVP]" wrote: Try prefixing each one with "=" to force Outlook to perform an exact match on the name when it tries to resolve. "JoD" wrote in message ... I am using Microsoft Office 2007 to create Outlook calendar appointments from Access. I can successfully do this with one exception: I have a series of calendars with similar names - the last portion of the name, for the 16 calendars, ranges from SEMI-1 to SEMI-16. With the code below, the .Resolve method is unsuccessful for only the calendar ...SEMI-1. I have verified that the name correctly matches the name of the calendar. Any suggestions would be appreciated (including renaming that calendar, if necessary!) Dim objOutlook As Outlook.Application Dim objNameSpace As Outlook.NameSpace Dim objRecipient As Outlook.Recipient Dim objFolder As Outlook.MAPIFolder Dim objItems As Outlook.Items Dim objAppt As Outlook.AppointmentItem Dim myCalendar, strStart, strShortTime As String 'find and delete the corresponding calendar appointment Set objOutlook = CreateObject("Outlook.Application") Set objNameSpace = objOutlook.GetNamespace("MAPI") If Len(Trim(Nz(Me!cboCalendar.Column(0)))) 0 Then ' proceed, should be an appointment myCalendar = strCalendar Set objRecipient = objNameSpace.CreateRecipient(myCalendar) ' check calendar name objRecipient.Resolve If objRecipient.Resolved Then ' create start date/time strStart = strExamDate & " " & strStartTime strStart = Format(strExamDate & " " & strStartTime, "mm/dd/yyyy hh:mm AMPM") ' set values for objects and delete appointment Set objFolder = objNameSpace.GetSharedDefaultFolder(objRecipient, olFolderCalendar) Set objItems = objFolder.Items Set objAppt = objItems.Find("[Start] = """ & strStart & """") If objAppt Is Nothing Then MsgBox ("This appointment was not found in Outlook") Else objAppt.Delete Set objAppt = Nothing 'Now display appropriate message MsgBox ("Appointment deleted from Outlook") End If Set objItems = Nothing Set objFolder = Nothing Else MsgBox ("No appointment deleted, could not resolve calendar name") End If Else MsgBox ("No appointment deleted, no existing appointment") End If 'Release the object variables Set objNameSpace = Nothing Set objRecipient = Nothing Set objOutlook = Nothing |
#5
|
|||
|
|||
![]()
Just replace the argument for the CreateRecipient Method with a fully qualified email address (of the recipient)
Set objRecipient = objNameSpace.CreateRecipient ("abc @ company.com") I had faced a similar issue and this did the trick for me ! Raguram Last edited by Raguram : November 9th 12 at 07:37 PM. Reason: code snippet not displayed properly |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook Wont Resolve Addresses - help! | Davy | Outlook - General Queries | 8 | May 17th 08 10:24 PM |
turn off resolve recipient | James | Outlook - Using Contacts | 1 | May 22nd 07 10:28 PM |
Problems with Autocomplete/resolve Outlook 2003 | [email protected] | Outlook - General Queries | 0 | July 27th 06 09:04 PM |
Problems with Recipient.Add and Macro Signing ??? | asousa | Outlook - Using Forms | 3 | June 19th 06 04:14 PM |
Maintain form when recipient forwards to another recipient | Holly Utzinger | Outlook - Using Forms | 3 | May 5th 06 12:40 AM |