-
May 4th, 2017, 05:38 PM
#1
Thread Starter
New Member
sendkeys from Excel to Outlook
Currently tasked with monitoring a group mailbox for specific subjects. While I can loop through the folder in VBA and look at each mailitem there are over 35,000 mail items and it takes hours to process. I note however, that I can manually enter CTRL-A, CTRL-C and paste the list into an Excel sheet in under two minutes.
I have tried creating the Outlook mail app and setting a folder in VBA but can't get a handle on how to use sendkeys "{^A}" from the Excel app to the Outlook object.
Any ideas greatly appreciated.
Regards,
vb1der
-
May 5th, 2017, 03:48 AM
#2
Re: sendkeys from Excel to Outlook
What do you when you find the "specific subjects?" While there are 35,000 mail items, are there a lot that contain the subjects you're looking for? If not, maybe you could create an Outlook rule to copy them to a different folder?
-
May 5th, 2017, 06:03 AM
#3
Re: sendkeys from Excel to Outlook
depending on os version and other factors sendkeys may not work at all, but there are alternatives
as i have no idea what your actual goal is, hard to make other suggestions, but there is a restrict method for mailitem collections
what code have you tried so far
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
May 5th, 2017, 02:32 PM
#4
Thread Starter
New Member
Re: sendkeys from Excel to Outlook
Originally Posted by vbfbryce
What do you when you find the "specific subjects?" While there are 35,000 mail items, are there a lot that contain the subjects you're looking for? If not, maybe you could create an Outlook rule to copy them to a different folder?
I am a member in the group folder but have not found a way to apply a rule to it. Once I find subjects that match a list I have in Excel I would prepare a report. The ultimate goal is to check that specific reports have gone out daily or monthly and prepare a mail to the boss to let him know if any of the reports are late going out.
-
May 5th, 2017, 02:43 PM
#5
Thread Starter
New Member
Re: sendkeys from Excel to Outlook
i dim'ed a namespace for midi and an outlook application object and created a folder object from that hoping that i could use sendkeys as an event on the outlook object but no soap. The idea was to use Excel VBA and sendkeys to imitate the manual process of copy/paste the folder contents into an Excel sheet. The manual process only takes 3 to 5 minutes, while creating a folder object and looking at each item in the folder takes hours and hours on our network and sometimes pauses for minutes while Exchange catches up with the requests from outlook.
Last edited by vb1der; May 5th, 2017 at 02:47 PM.
-
May 6th, 2017, 02:06 AM
#6
Re: sendkeys from Excel to Outlook
Did you try looking at alternative methods such as the Find method rather than blatantly looking at all items in the given folder?
https://msdn.microsoft.com/en-us/lib...tems.find.aspx
I know that looping the folders can take a LONG time because you have to unbox the mailitem to see its properties.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|