Forum

Copy rows from Outl...
 
Notifications
Clear all

Copy rows from Outlook to Excel

5 Posts
2 Users
0 Reactions
57 Views
(@shir0206)
Posts: 3
Active Member
Topic starter
 

Hello my friends,

I use Microsoft Outlook 2010/2013.
I created a rule that copies each sent/received appointment that contains the words “CCB Meeting” to the folder “CCB Meetings”.

Now, I would like to create a Macro in VBA in Excel, that runs throw “CCB Meetings” folder in the mail, and creates a list for each row of all the following information: From, Subject (Including the prefix ‘Accepted’/’Declined’ etc.), Received, To, CC, Start, End, Duration, Recurrence Range Start, Meeting Status, Conversation, Location.
(Exactly as it is in the print screen).

Later on I could continue writing that code, in order to analyze these report of appointments.

I tried to do so, but I got stuck, because I don't familiar very well with Outlook objects...

Could anyone help me?

 

 
Posted : 01/04/2019 6:04 am
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
 

Hi,

Attached is some code to get your most of the way there.  I don't have a folder full of appointments to test this with so try it with yours and see how you get along.

To get this to work you need to set a reference in the VBA Editor to the Microsoft Outlook 15.0 Object Library

Regards

Phil

 
Posted : 04/04/2019 1:02 am
(@shir0206)
Posts: 3
Active Member
Topic starter
 

Thanks! It works! well, sort of... I get run-time error in lines 'To','CC' & 'Location' that says "Object doesn't support this property or method". The other properties are perfectly printed in Excel.

What can I do to solve that error?

Also, where can I read more about the Objects 'Start'/'End' in order to print them also? 

 
Posted : 04/04/2019 2:07 am
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
 

Your appointments do not have that particular property.  Edit/Remove/Comment Out those lines.  You can read up on Appointment Items here

https://docs.microsoft.com/en-us/office/vba/api/outlook.appointmentitem

Regards

Phil

 
Posted : 04/04/2019 2:43 am
(@shir0206)
Posts: 3
Active Member
Topic starter
 

Of course I can remove/comment these lines, but I am trying to print these properties... Why it doesn't work?

Also, 'Email' is defined as "Variant", how can I turn it into "Appointment Item"? I read in the documentary that there are the some properties I would like to print. However, the commend "Range("D1").Offset(i,0).Value = Email.StartOn" doesn't compile for some reason.

Is there any other way to just "copy" a String for each email of all the required properties?

 
Posted : 04/04/2019 2:58 am
Share: