I'm trying to set up a form where the user can click on a button and it pulls the email address of a contact, creates a new email, allows the user to type out their email and send it, then save the email into a table.
I have it working, except for one little issue. In earlier versions of Outlook (2003 and earlier), you can set up Word as the email editor. If this is the case, the code never completes.
Dim objOutlook As Object
Dim objmessage As Object
Dim myInspector As Variant
Set objOutlook = CreateObject("outlook.application", "localhost")
Set objmessage = objOutlook.createItem(0)
objmessage.To = Me!email
Set myInspector = objmessage.GetInspector
myInspector.display
(v THIS IS THE CODE THAT LOOPS, SEE BELOW v)
While Not myInspector.CurrentItem Is Nothing
DoEvents
Wend
When Outlook is the email editor, the while block marked above loops until the user either sends or closes the email message (myInspector.CurrentItem gets cleared). It then continues from there to pull the information back into Access. However, when Word is the email editor, the code marked above loops forever (myInspector.CurrentItem never gets cleared). Anyone know why it might be doing this? And if you do, what can I do to resolve this so it works for Word as the email editor like it does for Outlook?