A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Check whether mail item is proper for sending or not



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 31st 09, 01:32 PM posted to microsoft.public.outlook.program_addins
Dhananjay
external usenet poster
 
Posts: 33
Default Check whether mail item is proper for sending or not

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  
Old January 2nd 10, 05:00 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Check whether mail item is proper for sending or not

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  
Old January 4th 10, 10:41 AM posted to microsoft.public.outlook.program_addins
Dhananjay
external usenet poster
 
Posts: 33
Default Check whether mail item is proper for sending or not

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  
Old January 4th 10, 05:43 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Check whether mail item is proper for sending or not

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  
Old January 5th 10, 12:03 PM posted to microsoft.public.outlook.program_addins
Sam Admin
external usenet poster
 
Posts: 1
Default Check whether mail item is proper for sending or not

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  
Old January 8th 10, 10:48 AM posted to microsoft.public.outlook.program_addins
Nic
external usenet poster
 
Posts: 1
Default Check whether mail item is proper for sending or not

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
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 01:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.