D
djohnson
Hello, I'm now on my first custom Outlook Form. It's nothing fancy.
It's just code on the sender's end. So I am using olMailItem to send
mail to avoid sending the entire form so the recipient does not get a
"cannot view in the reading pane" message. I've just added a few
fields to the Message Form that transfer selection to the text in the
body. That is working fine. The problem happens during the send
command.
On computers other than my own, on a seemingly sporadic basis, they get
the error "outlook does not recognize one or more names" I have read
about this possibly being a corrupt address book problem, but I don't
know if that is the case. I think there might be something wrong with
my code. I'm particularly uncertain about "olmail.To = Item.To" and
"olmail.CC = Item.CC". Can I do that? If not, how? If this does
involve the address book is it possible to detect which names are not
being found?
Another big question is, is there any better way to avoid receipients
getting a message about code in their reading pane than what I'm doing?
Anyway, here is what I'm doing... maybe someone could point me in the
right direction?
Function Item_Send()
'On Error Resume Next
Set olapp = CreateObject("Outlook.Application")
Set olmail = olapp.CreateItem(olMailItem)
With olMail
olmail.To = Item.To
olmail.CC = Item.CC
olmail.Subject = Item.Subject
olmail.body = Item.Body
olmail.Send
End With
Set objInsp = Item.GetInspector
objInsp.Close 1
End Function
It's just code on the sender's end. So I am using olMailItem to send
mail to avoid sending the entire form so the recipient does not get a
"cannot view in the reading pane" message. I've just added a few
fields to the Message Form that transfer selection to the text in the
body. That is working fine. The problem happens during the send
command.
On computers other than my own, on a seemingly sporadic basis, they get
the error "outlook does not recognize one or more names" I have read
about this possibly being a corrupt address book problem, but I don't
know if that is the case. I think there might be something wrong with
my code. I'm particularly uncertain about "olmail.To = Item.To" and
"olmail.CC = Item.CC". Can I do that? If not, how? If this does
involve the address book is it possible to detect which names are not
being found?
Another big question is, is there any better way to avoid receipients
getting a message about code in their reading pane than what I'm doing?
Anyway, here is what I'm doing... maybe someone could point me in the
right direction?
Function Item_Send()
'On Error Resume Next
Set olapp = CreateObject("Outlook.Application")
Set olmail = olapp.CreateItem(olMailItem)
With olMail
olmail.To = Item.To
olmail.CC = Item.CC
olmail.Subject = Item.Subject
olmail.body = Item.Body
olmail.Send
End With
Set objInsp = Item.GetInspector
objInsp.Close 1
End Function