View Single Post
 
Old 12-11-2023, 01:49 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The code works on my machine so let's step through possible problems.
1. CreateObject 'could' be a problem if Outlook was already open. So you might tell vba to ignore errors and try getobject first and if no object is created, then use createobject
2. You can add DoEvents after opening the app to give it time to load before proceeding with the next steps
3. If you are using late binding to create the application then don't use variables that are only available when a reference is set to that application. olMailItem and olImportanceNormal should be replaced by their integer value.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote