PC Review


Reply
Thread Tools Rate Thread

Check whether mail item is proper for sending or not

 
 
Dhananjay
Guest
Posts: n/a
 
      31st Dec 2009
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
 
Reply With Quote
 
 
 
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      2nd Jan 2010
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" <(E-Mail Removed)> wrote in message
news:bcf356bc-31af-416c-861e-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Dhananjay
Guest
Posts: n/a
 
      4th Jan 2010
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" <dmi...@dimastr.com> 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" <pandit.dhanan...@gmail.com> wrote in message
>
> news:bcf356bc-31af-416c-861e-(E-Mail Removed)...
>
> > 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


 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      4th Jan 2010
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" <(E-Mail Removed)> wrote in message
news:225c8521-adb5-4243-846f-(E-Mail Removed)...
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" <dmi...@dimastr.com> 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" <pandit.dhanan...@gmail.com> wrote in message
>
> news:bcf356bc-31af-416c-861e-(E-Mail Removed)...
>
> > 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



 
Reply With Quote
 
Sam Admin
Guest
Posts: n/a
 
      5th Jan 2010
Thanks again Dmitry for your reply and code!.

On Jan 4, 9:43*pm, "Dmitry Streblechenko" <dmi...@dimastr.com> 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" <pandit.dhanan...@gmail.com> wrote in message
>
> news:225c8521-adb5-4243-846f-(E-Mail Removed)...
> 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" <dmi...@dimastr.com> 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" <pandit.dhanan...@gmail.com> wrote in message

>
> >news:bcf356bc-31af-416c-861e-(E-Mail Removed)...

>
> > > 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


 
Reply With Quote
 
Nic
Guest
Posts: n/a
 
      8th Jan 2010
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 private.php?do=newpm&u=

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:0
> Thanks again Dmitry for your reply and code!.
>
> On Jan 4, 9:43*pm, "Dmitry Streblechenko" <dmi...@dimastr.com> 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" <pandit.dhanan...@gmail.com> wrote in message
> >
> > news:225c8521-adb5-4243-846f-(E-Mail Removed)...
> > 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" <dmi...@dimastr.com> 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" <pandit.dhanan...@gmail.com> wrote in message

> >
> > >news:bcf356bc-31af-416c-861e-(E-Mail Removed)...

> >
> > > > 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Large Item in Outbox Peventing me from sending mail Peter Mller Microsoft Outlook Discussion 2 13th Apr 2009 10:32 PM
Relaying denied: You must check for new mail before sending mail. Jeanne Hampl Microsoft Outlook Discussion 9 28th Apr 2008 12:03 AM
post item to mail folder without sending mail John Keith Microsoft Outlook 4 26th Apr 2007 05:06 AM
Relaying denied: You must check for new mail before sending mail =?Utf-8?B?QnJpYW4=?= Microsoft Outlook Discussion 1 18th Oct 2006 06:35 AM
Error: Relaying denied: You must check for new mail before sending mail. Leo Microsoft Outlook Discussion 1 29th Jan 2004 08:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:47 AM.