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 » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook Script: How to get the result of an action



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 18th 06, 09:22 AM posted to microsoft.public.outlook.program_vba
news.microsoft.com
external usenet poster
 
Posts: 65
Default Outlook Script: How to get the result of an action

Hi all,

I want to check the result of an action to apply the de right function, In
my case I save a Task, I used a customized Form and I added a validation
control on some fields = the task can't be saved if some are empty

I want to know the result of this command

Item.Save

Tks


  #2  
Old October 19th 06, 08:03 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook Script: How to get the result of an action

Am Wed, 18 Oct 2006 09:22:36 +0200 schrieb news.microsoft.com:

If the Save method fails it should raise an error.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Hi all,

I want to check the result of an action to apply the de right function, In
my case I save a Task, I used a customized Form and I added a validation
control on some fields = the task can't be saved if some are empty

I want to know the result of this command

Item.Save

Tks

  #3  
Old October 19th 06, 10:15 AM posted to microsoft.public.outlook.program_vba
news.microsoft.com
external usenet poster
 
Posts: 65
Default Outlook Script: How to get the result of an action

Yes I that if save fails it raise an error, but in my script how can I know
if the save was successfull or not

in my script I want to do this
Item.Save
If "the instruction was successfull " then = I don't know how to do
this check
do some thing
else
do other thing
end if


Thks


"Michael Bauer [MVP - Outlook]" a écrit dans le message de
news: ...
Am Wed, 18 Oct 2006 09:22:36 +0200 schrieb news.microsoft.com:

If the Save method fails it should raise an error.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Hi all,

I want to check the result of an action to apply the de right function,
In
my case I save a Task, I used a customized Form and I added a validation
control on some fields = the task can't be saved if some are empty

I want to know the result of this command

Item.Save

Tks



  #4  
Old October 20th 06, 06:54 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook Script: How to get the result of an action

Am Thu, 19 Oct 2006 10:15:25 +0200 schrieb news.microsoft.com:

For error handling in VB there are two opportunities:

1)
On Error Resume Next
Item.Save
If Err.Number 0 Then ... ' no success

2)
On Error Goto ERR_HANDLER
Item.Save
' maybe more code here
Exit Sub
ERR_HANDLER:
' error handling here

#1 tells you exactly what line caused an error even if you don´t know the
error number. On the other side, if you do have more commands in the
function then it can really blow up the code.

#2 catches all errors even unexpected ones. You could add line numbers to
your code and the Erl function would tell you which line caused the error.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Yes I that if save fails it raise an error, but in my script how can I

know
if the save was successfull or not

in my script I want to do this
Item.Save
If "the instruction was successfull " then = I don't know how to do
this check
do some thing
else
do other thing
end if


Thks


"Michael Bauer [MVP - Outlook]" a 袲it dans le message de
news: ...
Am Wed, 18 Oct 2006 09:22:36 +0200 schrieb news.microsoft.com:

If the Save method fails it should raise an error.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Hi all,

I want to check the result of an action to apply the de right function,
In
my case I save a Task, I used a customized Form and I added a validation
control on some fields = the task can't be saved if some are empty

I want to know the result of this command

Item.Save

Tks

  #5  
Old October 20th 06, 01:18 PM posted to microsoft.public.outlook.program_vba
news.microsoft.com
external usenet poster
 
Posts: 65
Default Outlook Script: How to get the result of an action (Solved)

It work great , Tks a lot

Bye
"Michael Bauer [MVP - Outlook]" a écrit dans le message de
news: ...
Am Thu, 19 Oct 2006 10:15:25 +0200 schrieb news.microsoft.com:

For error handling in VB there are two opportunities:

1)
On Error Resume Next
Item.Save
If Err.Number 0 Then ... ' no success

2)
On Error Goto ERR_HANDLER
Item.Save
' maybe more code here
Exit Sub
ERR_HANDLER:
' error handling here

#1 tells you exactly what line caused an error even if you don´t know the
error number. On the other side, if you do have more commands in the
function then it can really blow up the code.

#2 catches all errors even unexpected ones. You could add line numbers to
your code and the Erl function would tell you which line caused the error.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
--
www.VBOffice.net --


Yes I that if save fails it raise an error, but in my script how can I

know
if the save was successfull or not

in my script I want to do this
Item.Save
If "the instruction was successfull " then = I don't know how to do
this check
do some thing
else
do other thing
end if


Thks


"Michael Bauer [MVP - Outlook]" a ?it dans le message de
news: ...
Am Wed, 18 Oct 2006 09:22:36 +0200 schrieb news.microsoft.com:

If the Save method fails it should raise an error.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Hi all,

I want to check the result of an action to apply the de right function,
In
my case I save a Task, I used a customized Form and I added a
validation
control on some fields = the task can't be saved if some are empty

I want to know the result of this command

Item.Save

Tks



 




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
Custom Action or Script to Purge Deleted Messages on IMAP account Frank M. Outlook and VBA 9 July 10th 09 07:44 PM
Outlook contact to Word Mail Merge result blank line before City, State, Zip Randy Outlook - Using Contacts 6 October 5th 06 02:37 AM
Access quey result (emails) directly loaded into Outlook "TO" fiel MSA Outlook - General Queries 1 September 27th 06 03:47 PM
Outlook installer class with custom action AtulSureka Add-ins for Outlook 0 July 31st 06 04:39 PM
Rule 'run a script' not running my script [email protected] Outlook and VBA 3 May 30th 06 01:09 PM


All times are GMT +1. The time now is 12:53 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.