score:0
resolve does nothing when you use an email address.
use display name / other name property in createrecipient
if you want to follow up with a useful if myrecipient.resolved then
.
option explicit
sub resolvename()
' déclaration des variables
dim outlookapp as outlook.application
dim mynamespace as outlook.namespace
dim myrecipient as outlook.recipient
dim calendarfolder as outlook.folder
dim calendarapp as outlook.appointmentitem
dim calendaritem as outlook.items
dim i as long
set outlookapp = new outlook.application
set mynamespace = outlookapp.getnamespace("mapi")
set myrecipient = mynamespace.createrecipient("nothingvalid@hydro.qc.ca")
i = 2
myrecipient.resolve
'range("a1:d1").value = array("subject", "from", "date", "location")
if myrecipient.resolved then
debug.print "anything that looks like an email address will resolve."
debug.print "use display name / other name property."
'set calendarfolder = mynamespace.getshareddefaultfolder(myrecipient, olfoldercalendar)
'for each calendarapp in calendarfolder.items
' cells(i, 1).value = calendaritem.subject
' cells(i, 2).value = calendaritem.start
' cells(i, 3).value = calendaritem.end
' cells(i, 4).value = calendaritem.location
' cells(i, 5).value = calendaritem.meetingstatus
' i = i + 1
' next
end if
set outlookapp = nothing
set mynamespace = nothing
set myrecipient = nothing
set calendarfolder = nothing
set calendaritem = nothing
end sub
Source: stackoverflow.com
Related Query
- Import Shared Group Outlook Calendar Appointments to Excel
- Import Excel Appointments to Outlook Shared Calendar
- Extracting appointments from shared Outlook calendar to Excel
- Saving appointments to a shared Outlook calendar from Excel
- Deleting appointments from shared Outlook calendar
- Import dates from Excel to Outlook Calendar
- Outlook 2010 VBA code to copy only certain appointments from a shared calendar to another persons calendar that i have access to
- Import contact group from outlook - excel vba
- Loading appointments to a non-default Outlook calendar from Excel
- How to reference group or shared calendar in Outlook 365 Exchange using Excel?
- How to import emails from outlook into excel document when it is a shared email inbox
- Exporting Outlook calendar data to Excel file - Shared calendars and VBA
- Excel Create an Outlook calendar event
- Outlook 2007 Macro to Copy Appointments from iCloud Calendar to Default Calendar
- Import Outlook Emails to Excel Oldest to Newest for a Specified Date Range
- Excel 2010 VBA code to delete all Outlook appointments
- Import Outlook emails to Excel for specified Date Range
- How to import email from a shared mailbox subfolder too, and mark the foldername in Excel
- Get Outlook Shared Calendar without Delegation VBA/C#
- Send appointments to shared calendar
- Import Most Recent Emails from Outlook Into Excel (VBA)
- VBA Excel to Outlook (2010) - Creating Appointments from Date column with Unique dates only
- Outlook 2013 VBA display Shared Calendar
- Convert Outlook Contact Group early binding Excel VBA to late binding
- Outlook Calendar Trigger Excel Workbook Open
- Import Outlook User-Defined Field to Excel with VBA
- Export Shared Task list from MS outlook into Excel
- How to solve error'1004' in vba when import outlook mail to excel
- How to extract sent items from Outlook shared mailbox in Excel VBA?
- Accessing a Shared Inbox from Outlook using Excel VBA
More Query from same tag
- Prompting user to select an option in VBA?
- How to use AND to apply two conditions in an If statement?
- Excel Macro SUMIF Why is this returning False?
- If statement has me stumped
- Excel to Outlook VBA pre-written body
- How to replace index number in data worksheet with lookup information in another worksheet?
- Inserting a picture in the correct position
- MultiSelect List Box Query
- Wrong number of Parameters for SQL Update Table
- Deleting Two Columns Simultaneously
- Print to PDF but with different page sizes for different sheets
- Excel VBA to Assign Border to a group based on Column name and Cell Value
- Microsoft Access can't save design changes because another user has the file open... but I am the only user?
- Excel VBA Single VS Double Data Type
- Word VBA Find/Replace Issue
- Vb.net : Interop exception when showAllData() on Excel sheet?
- Changing value based on matching value on different worksheet
- VBA Syntax error using Dir having contentenation and wildcards
- VBA Input to Hidden Input field that has a Lookup
- VBA Loop for filling worksheet
- Send HTML-formatted email messages from Access
- Subscript out of range error - combining worksheets
- Excel/VBA/SQL - refresh not working
- Declare PtrSafe Compatibility in Excel
- HTML date picker with no input field. use VBA to fire update event
- Use multiple custom lists to sort
- How to display stimestamps with microseconds in excel corrctly?
- Modify a word document with excel
- Writing column as a combination of letter and number in range
- Issue in TextToColumns with xlFixedWidth loosing blanks