Check whether mail item is proper for sending or not

Status
Not open for further replies.
D

Dhananjay

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
 
Loop through all recipients in the MailItem.Recipients collecito nand check

if Recipient.Resolved = true.

Dmitry Streblechenko (MVP)

-

"Dhananjay" <pandit.dhananjay@gmail.com> wrote in message

news:bcf356bc-31af-416c-861e-d511e38f7e2c@j4g2000yqe.googlegroups.com...
> 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
 
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)
> OutlookSpy  - Outlook, CDO
>

> -"Dhananjay" <pandit.dhanan...@gmail.com> wrote in message

> news:bcf356bc-31af-416c-861e-d511e38f7e2c@j4g2000yqe.googlegroups.com...
>
> > 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
 
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)

-

"Dhananjay" <pandit.dhananjay@gmail.com> wrote in message

news:225c8521-adb5-4243-846f-0514092c176c@34g2000yqp.googlegroups.com...

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

>

> -"Dhananjay" <pandit.dhanan...@gmail.com> wrote in message

> news:bcf356bc-31af-416c-861e-d511e38f7e2c@j4g2000yqe.googlegroups.com...
>
> > 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
 
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)
> OutlookSpy  - Outlook, CDO
>

> -"Dhananjay" <pandit.dhanan...@gmail.com> wrote in message

> news:225c8521-adb5-4243-846f-0514092c176c@34g2000yqp.googlegroups.com...
> 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)
> >

> >

> > -"Dhananjay" <pandit.dhanan...@gmail.com> wrote in message

>
> >news:bcf356bc-31af-416c-861e-d511e38f7e2c@j4g2000yqe.googlegroups.com...

>
> > > 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
 
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 mailto:nic.oosthuizen1@gmail.com

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" <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)
> > OutlookSpy  - Outlook, CDO
> >

> > -"Dhananjay" <pandit.dhanan...@gmail.com> wrote in message
> > news:225c8521-adb5-4243-846f-0514092c176c@34g2000yqp.googlegroups.com...
> > 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)
> > >

> > >

> > > -"Dhananjay" <pandit.dhanan...@gmail.com> wrote in message

> >
> > >news:bcf356bc-31af-416c-861e-d511e38f7e2c@j4g2000yqe.googlegroups.com...

> >
> > > > 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
H out to check whether outlook configured or not Outlook VBA and Custom Forms 1
P turn off the default "all day" check box in new calendar items. How? Using Outlook 1
L Help: set flag for sent mail to check if received an answer Outlook VBA and Custom Forms 2
Witzker Outlook 2019 Macro to check Cursor & Focus position Outlook VBA and Custom Forms 8
CWM550 Saving Data: Don't check certain folders Using Outlook 2
Victor.Ayala Automated way to check the option "Show this folder as an email Address Book" Outlook VBA and Custom Forms 2
D Spell check Outlook VBA and Custom Forms 3
L Spell-check dictionary confusion Using Outlook 0
S How to export urls from email to excel and check the status of the url ? Using Outlook 5
N Private check box in table view Using Outlook 0
S Outlook to check for specific text Outlook VBA and Custom Forms 3
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
O Outlook 2016 This rule will only run when you check your email in Outlook.... Using Outlook 4
A Check for words in subject header before sending email Outlook VBA and Custom Forms 4
R Using "check for duplicates" for existing contacts Using Outlook 2
P Suppress dialog box on email check error? Using Outlook 5
Potty Ash MS Outlook 2010 custom form - validation or formula to request user to check a checkbox Outlook VBA and Custom Forms 16
I Check if sent email has been replied Outlook VBA and Custom Forms 1
K adding more rules to 'different domains check' macro Outlook VBA and Custom Forms 2
R Macro to check file name with outlook address book Outlook VBA and Custom Forms 0
Diane Poremsky Check Contacts before moving them to Hotmail Contacts folder Using Outlook 0
Diane Poremsky Check for missing attachments before sending a message Using Outlook 1
R Outlook 2010 Modify Style "Do not check spelling or grammar" not saving Outlook VBA and Custom Forms 0
K check for sender, follow to my personal adress and delete the sent folder. Outlook VBA and Custom Forms 1
J Send and Receive Button - only check default account? Using Outlook 1
A Check for attachment code not working Outlook VBA and Custom Forms 1
Diane Poremsky Check Message Size Before Sending Using Outlook 0
B Check for different domains macro to be triggered by specific domains only Outlook VBA and Custom Forms 2
V Check/convert to emailaddresses Outlook VBA and Custom Forms 11
JorgeDario how to check a MailItem has a digital signature (SMIME) with vba? Outlook VBA and Custom Forms 1
O Unable to check name. Using Outlook 3
R Outlook Custom form check if there an attachment Outlook VBA and Custom Forms 2
L Trying to check for the absence of mail. Outlook VBA and Custom Forms 1
S Check if two organisition is added then i have to give managers passward creteria to send mail Using Outlook 1
Peter H Williams check for new email automaticlly Using Outlook 12
C Unusual Signature & Spell Check Query Using Outlook 1
M Calendar navigation displays previous field records.check calendar is shared.. Using Outlook 3
A Can Rule Check Category Contact is assigned? Using Outlook 1
T Outlook 2007 forms: Check boxes and free text boxes not retaining data Using Outlook 1
L check if send message appears in SendItems forder before moving Using Outlook 0
C Create a rule to only check new content in email - disregard original content Using Outlook 3
M Outlook Rules check for new line character Using Outlook 1
G Outlook rule check for messages not received Outlook VBA and Custom Forms 2
E Outlook could not create the work file. Check the temp environment variable Using Outlook 8
B Custom real time, time format check Outlook VBA and Custom Forms 1
B BCM shuts down everytime I try to import/export or check for error BCM (Business Contact Manager) 10
P Check for the distribution list existence Outlook VBA and Custom Forms 1
M Check Profile info Outlook VBA and Custom Forms 1
L Check sent email and reply if have specific words Outlook VBA and Custom Forms 2
Z Check if email was sent Outlook VBA and Custom Forms 1

Similar threads

Back
Top