![]() |
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
|
|||
|
|||
![]()
Hi,
I have added one button on ribbon viz. "Upload and Send" in ol 2007 / vb 2005. When user will click on that button, I want to get information about message like To, CC, body etc and upload that information to web via web service & send it. But as uploading of mail information is done before sending, if there are some problems while sending like - "Could not resolve email address in To,CC" or problems related to spell check etc, then I can not reverse the process of uploading of mail. Is there any way to check beforehand whether mail item is proper to send or not? So that I could check this part before uploading. Thanks, D |
Ads |
#2
|
|||
|
|||
![]()
Loop through all recipients in the MailItem.Recipients collecito nand check
if Recipient.Resolved = true. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Dhananjay" wrote in message ... Hi, I have added one button on ribbon viz. "Upload and Send" in ol 2007 / vb 2005. When user will click on that button, I want to get information about message like To, CC, body etc and upload that information to web via web service & send it. But as uploading of mail information is done before sending, if there are some problems while sending like - "Could not resolve email address in To,CC" or problems related to spell check etc, then I can not reverse the process of uploading of mail. Is there any way to check beforehand whether mail item is proper to send or not? So that I could check this part before uploading. Thanks, D |
#3
|
|||
|
|||
![]()
Thanks Dmitry for your valuable reply, but could you please tell me
what should I do for Spell check, Signature issues. Since I want to perform my upload and send operation synchronously, I realized that with the check Recipient.Resolved, I managed issues related to recipients but still spell check is happening after my upload. Thanks in advance On Jan 2, 9:00*pm, "Dmitry Streblechenko" wrote: Loop through all recipients in the MailItem.Recipients collecito nand check if Recipient.Resolved = true. -- Dmitry Streblechenko (MVP)http://www.dimastr.com/ OutlookSpy *- Outlook, CDO and MAPI Developer Tool -"Dhananjay" wrote in message ... Hi, I have added one button on ribbon viz. "Upload and Send" in ol 2007 / vb 2005. When user will click on that button, I want to get information about message like To, CC, body etc and upload that information to web via web service & send it. But as uploading of mail information is done before sending, if there are some problems while sending like - "Could not resolve email address in To,CC" or problems related to spell check etc, then I can not reverse the process of uploading of mail. Is there any way to check beforehand whether mail item is proper to send or not? So that I could check this part before uploading. Thanks, D |
#4
|
|||
|
|||
![]()
To run spell check, read the Inspector.WordEditor property (returns
Word.Document object). You can then call Document.CheckSpelling. Below is the function that I use (Delphi): //return true if the spelling does not have to be checked or if it was checked successfully function TMyAddin.TryCheckSpelling(Inspector: OleVariant): boolean; var vDocument : OleVariant; strKeyName : string; v : integer; begin Result:=true; //everything is OK unless we find otherwise with TRegistry.Create(KEY_READ) do begin try RootKey:=HKEY_CURRENT_USER; strKeyName:=Format('Software\Microsoft\Office\%s.0 \Outlook\Options\Spelling', [IntToStr(fVersion)]); //DNL if KeyExists(strKeyName) then begin if OpenKey(strKeyName, false) then begin //DNL if ValueExists('Check') then begin //DNL v:=ReadInteger('Check'); if v 0 then begin //yes, we must check the spelling vDocument:=Inspector.WordEditor; if (VarType(vDocument) = VarDispatch) and (IDispatch(vDocument) nil) then begin //at least we have the Word.Document object vDocument.CheckSpelling; if vDocument.SpellingErrors.Count 0 then begin //display a prompt if there are errors if IDNO = MessageBox(GetForegroundWindow, PChar(rsSpellingErrors), 'SalesLogix', MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON1) then begin //DNL //do not send Result:=false; end; end; end; end; end; end; end; finally Free; //TRegistry end; end; end; -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Dhananjay" wrote in message ... Thanks Dmitry for your valuable reply, but could you please tell me what should I do for Spell check, Signature issues. Since I want to perform my upload and send operation synchronously, I realized that with the check Recipient.Resolved, I managed issues related to recipients but still spell check is happening after my upload. Thanks in advance On Jan 2, 9:00 pm, "Dmitry Streblechenko" wrote: Loop through all recipients in the MailItem.Recipients collecito nand check if Recipient.Resolved = true. -- Dmitry Streblechenko (MVP)http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool -"Dhananjay" wrote in message ... Hi, I have added one button on ribbon viz. "Upload and Send" in ol 2007 / vb 2005. When user will click on that button, I want to get information about message like To, CC, body etc and upload that information to web via web service & send it. But as uploading of mail information is done before sending, if there are some problems while sending like - "Could not resolve email address in To,CC" or problems related to spell check etc, then I can not reverse the process of uploading of mail. Is there any way to check beforehand whether mail item is proper to send or not? So that I could check this part before uploading. Thanks, D |
#5
|
|||
|
|||
![]()
Thanks again Dmitry for your reply and code!.
On Jan 4, 9:43*pm, "Dmitry Streblechenko" wrote: To run spell check, read the Inspector.WordEditor property (returns Word.Document object). You can then call Document.CheckSpelling. Below is the function that I use (Delphi): //return true if the spelling does not have to be checked or if it was checked successfully function TMyAddin.TryCheckSpelling(Inspector: OleVariant): boolean; var vDocument : OleVariant; * * strKeyName : string; * * v : integer; begin * Result:=true; //everything is OK unless we find otherwise * with TRegistry.Create(KEY_READ) do begin * * try * * * RootKey:=HKEY_CURRENT_USER; * * * strKeyName:=Format('Software\Microsoft\Office\%s.0 \Outlook\Options\Spelling', [IntToStr(fVersion)]); * *//DNL * * * if KeyExists(strKeyName) then begin * * * * if OpenKey(strKeyName, false) then begin //DNL * * * * * if ValueExists('Check') then begin //DNL * * * * * * v:=ReadInteger('Check'); * * * * * * if v 0 then begin * * * * * * * //yes, we must check the spelling * * * * * * * vDocument:=Inspector.WordEditor; * * * * * * * if (VarType(vDocument) = VarDispatch) and (IDispatch(vDocument) nil) then begin * * * * * * * * //at least we have the Word.Document object * * * * * * * * vDocument.CheckSpelling; * * * * * * * * if vDocument.SpellingErrors.Count 0 then begin * * * * * * * * * //display a prompt if there are errors * * * * * * * * * if IDNO = MessageBox(GetForegroundWindow, PChar(rsSpellingErrors), 'SalesLogix', MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON1) then begin * //DNL * * * * * * * * * * //do not send * * * * * * * * * * Result:=false; * * * * * * * * * end; * * * * * * * * end; * * * * * * * end; * * * * * * end; * * * * * end; * * * * end; * * * end; * * finally * * * Free; *//TRegistry * * end; * end; end; -- Dmitry Streblechenko (MVP)http://www.dimastr.com/ OutlookSpy *- Outlook, CDO and MAPI Developer Tool -"Dhananjay" wrote in message ... Thanks Dmitry for your valuable reply, but could you please tell me what should I do for Spell check, Signature issues. Since I want to perform my upload and send operation synchronously, I realized that with the check Recipient.Resolved, I managed issues related to recipients but still spell check is happening after my upload. Thanks in advance On Jan 2, 9:00 pm, "Dmitry Streblechenko" wrote: Loop through all recipients in the MailItem.Recipients collecito nand check if Recipient.Resolved = true. -- Dmitry Streblechenko (MVP)http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool -"Dhananjay" wrote in message ... Hi, I have added one button on ribbon viz. "Upload and Send" in ol 2007 / vb 2005. When user will click on that button, I want to get information about message like To, CC, body etc and upload that information to web via web service & send it. But as uploading of mail information is done before sending, if there are some problems while sending like - "Could not resolve email address in To,CC" or problems related to spell check etc, then I can not reverse the process of uploading of mail. Is there any way to check beforehand whether mail item is proper to send or not? So that I could check this part before uploading. Thanks, D |
#6
|
|||
|
|||
![]()
Dhananjay,
I'm starting with a similar project. I don't suppose you'll be willing to share some code with me??? If so you can contact me on Under certain conditions I need to intercept a message and stream it to a web application.... Nic Sam Admin wrote on Tue, 05 January 2010 06:03 Thanks again Dmitry for your reply and code!. On Jan 4, 9:43*pm, "Dmitry Streblechenko" wrote: To run spell check, read the Inspector.WordEditor property (returns Word.Document object). You can then call Document.CheckSpelling. Below is the function that I use (Delphi): //return true if the spelling does not have to be checked or if it was checked successfully function TMyAddin.TryCheckSpelling(Inspector: OleVariant): boolean; var vDocument : OleVariant; * * strKeyName : string; * * v : integer; begin * Result:=true; //everything is OK unless we find otherwise * with TRegistry.Create(KEY_READ) do begin * * try * * * RootKey:=HKEY_CURRENT_USER; * * * strKeyName:=Format('Software\Microsoft\Office\%s.0 \Outlook\O ptions\Spelling', [IntToStr(fVersion)]); * *//DNL * * * if KeyExists(strKeyName) then begin * * * * if OpenKey(strKeyName, false) then begin //DNL * * * * * if ValueExists('Check') then begin //DNL * * * * * * v:=ReadInteger('Check'); * * * * * * if v 0 then begin * * * * * * * //yes, we must check the spelling * * * * * * * vDocument:=Inspector.WordEditor; * * * * * * * if (VarType(vDocument) = VarDispatch) and (IDispatch(vDocument) nil) then begin * * * * * * * * //at least we have the Word.Document object * * * * * * * * vDocument.CheckSpelling; * * * * * * * * if vDocument.SpellingErrors.Count 0 then begin * * * * * * * * * //display a prompt if there are errors * * * * * * * * * if IDNO = MessageBox(GetForegroundWindow, PChar(rsSpellingErrors), 'SalesLogix', MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON1) then begin * //DNL * * * * * * * * * * //do not send * * * * * * * * * * Result:=false; * * * * * * * * * end; * * * * * * * * end; * * * * * * * end; * * * * * * end; * * * * * end; * * * * end; * * * end; * * finally * * * Free; *//TRegistry * * end; * end; end; -- Dmitry Streblechenko (MVP)http://www.dimastr.com/ OutlookSpy *- Outlook, CDO and MAPI Developer Tool -"Dhananjay" wrote in message ... Thanks Dmitry for your valuable reply, but could you please tell me what should I do for Spell check, Signature issues. Since I want to perform my upload and send operation synchronously, I realized that with the check Recipient.Resolved, I managed issues related to recipients but still spell check is happening after my upload. Thanks in advance On Jan 2, 9:00 pm, "Dmitry Streblechenko" wrote: Loop through all recipients in the MailItem.Recipients collecito nand check if Recipient.Resolved = true. -- Dmitry Streblechenko (MVP)http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool -"Dhananjay" wrote in message ... Hi, I have added one button on ribbon viz. "Upload and Send" in ol 2007 / vb 2005. When user will click on that button, I want to get information about message like To, CC, body etc and upload that information to web via web service & send it. But as uploading of mail information is done before sending, if there are some problems while sending like - "Could not resolve email address in To,CC" or problems related to spell check etc, then I can not reverse the process of uploading of mail. Is there any way to check beforehand whether mail item is proper to send or not? So that I could check this part before uploading. Thanks, D |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
automatically check if attachment was added when sending message | kkappabear | Outlook and VBA | 3 | August 6th 07 02:18 PM |
post item to mail folder without sending mail | John Keith | Outlook - General Queries | 4 | April 26th 07 06:06 AM |
Check value in controls before sending a form | Lasse | Outlook - Using Forms | 1 | February 27th 07 03:31 PM |
Opening & Sending a previously saved mail item | WhytheQ | Outlook and VBA | 4 | May 9th 06 12:27 PM |
Sending custom form item as mail attachment to person outside org | DougMunday | Outlook - Using Forms | 4 | April 13th 06 09:02 PM |