![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 |
Ads |
#2
|
|||
|
|||
![]()
I would like to add a couple things....
The main problem is the error "could not recognize one or more names". If the error is in fact a result of PST file corruption I am not sure how to run scanpst.exe when, in our case, there is not local PST file that I can find since the information is stored on the Exchange server. Could someone tell me what file should be scanned? Thank you... djohnson wrote: 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 |
#3
|
|||
|
|||
![]()
Instead of using To, you should call Item.Recipients.ResolveAll on the
original item, and if that returns True, iterate the Item.Recipients collection and create matchin recipients on the new outgoing item. Never use CreateObject to create a new Outlook.Application object in your custom form code. Use the intrinsic Application object that is already available to you. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "djohnson" wrote: I would like to add a couple things.... The main problem is the error "could not recognize one or more names". If the error is in fact a result of PST file corruption I am not sure how to run scanpst.exe when, in our case, there is not local PST file that I can find since the information is stored on the Exchange server. Could someone tell me what file should be scanned? Thank you... djohnson wrote: 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 |
#4
|
|||
|
|||
![]() Sue wrote: Instead of using To, you should call Item.Recipients.ResolveAll on the original item, and if that returns True, iterate the Item.Recipients collection and create matchin recipients on the new outgoing item. I did that; thanks for the advice. Never use CreateObject to create a new Outlook.Application object in your custom form code. Use the intrinsic Application object that is already available to you. Would the intrinsic Application object be the Form Item? Maybe I misunderstand. It was my understanding that this would send the whole form including the code and end up creating a pane warning on the recipients' end, which I was trying to avoid (not sure who would want that). Since I only need code on the sender's end I don't want to send the whole form. |
#5
|
|||
|
|||
![]()
In any open form you have 2 intrinsic objects you never have to declare or
instantiate: Item (the form) and Application (the Outlook.Application object). So you don't use CreateObject to get a handle to Outlook.Application, you use the intrinsic Application object of the form. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "djohnson" wrote in message ups.com... Sue wrote: Instead of using To, you should call Item.Recipients.ResolveAll on the original item, and if that returns True, iterate the Item.Recipients collection and create matchin recipients on the new outgoing item. I did that; thanks for the advice. Never use CreateObject to create a new Outlook.Application object in your custom form code. Use the intrinsic Application object that is already available to you. Would the intrinsic Application object be the Form Item? Maybe I misunderstand. It was my understanding that this would send the whole form including the code and end up creating a pane warning on the recipients' end, which I was trying to avoid (not sure who would want that). Since I only need code on the sender's end I don't want to send the whole form. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Edit MailEnvelope.Item Before .Send | Jeff C | Outlook and VBA | 11 | June 21st 06 04:06 PM |
How can I create a outlook appointment item from data in a e-mail? | StoltHD | Outlook and VBA | 6 | June 17th 06 09:00 AM |
How can I create a outlook appointment item from data in a e-mail? | Eric Legault [MVP - Outlook] | Outlook and VBA | 0 | June 15th 06 07:23 PM |
Send.item ? | mrrcomp | Outlook and VBA | 2 | February 2nd 06 04:38 PM |
A program is trying to send mail using Item.Send | Vitesh | Outlook and VBA | 1 | January 23rd 06 03:25 PM |