K
Keven Denen
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 'Outlook.Application
Dim objmessage As Object 'MailItem
Dim Count As Integer
Dim myInspector
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 code marked above loops until
the user either sends or closes the email message. 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. 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?
Keven Denen
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 'Outlook.Application
Dim objmessage As Object 'MailItem
Dim Count As Integer
Dim myInspector
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 code marked above loops until
the user either sends or closes the email message. 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. 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?
Keven Denen