Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving Outlook Message
Message
From
13/03/2002 16:13:07
 
 
To
12/03/2002 08:53:11
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00631337
Message ID:
00632394
Views:
15
Hello Marcia, Garrett, and Gary

Well, I never fell into the no '=' sign trap, but thanks for the heads up. I also predicate every '=mymethod()' with a local as well. Generally, I find it good form to do so in that I can create an error trap for each mehtod in doing so. Even if a method does not have a return value (which I believe makes it an event), doesn't it by default return a .T. if it happend, or a .F. if it didn't?? This is not the whole code, but a snippet on some stuff so you get the idea....

ForEx:
 *-- myapp.cleanermethod
 LPARAMETER _activeobjectname
 LOCAL loForm, llError 
 IF EMPTY(_activeobjectname)
  RETURN .F.
 ENDIF
 *-- Now, here is where I trap to make sure all of my object controls are gone.... sometimes
 *-- I would forget to unhook something or another....
 llError = _activeobjectname.destroy()
 IF !llError
   *-- I was able to let VFP destroy the form and all of the containers it had as well...
   *-- I have no return value in the _activeformdestroy... if it happend and worked, it returns
   *-- .T.
 ENDIF
I hope I am not way wrong on this, because it works... lol...

Ric

(PS - no K in 'RIC', as in no 'K' in Richard... :-))

>Hi Rick.
>
>I am wondering if anyone has found a method via outlook automation to move a message from the inbox to another folder?? If so, could you please let me know... pulling my hair on this one...
>
>In addition to the advice you have already received about how the Message Indexes change as you move them, Keep in mind that you have to strore the result of the Move() to a variable. Otherwise Outlook (at least OL2K will) will give you back an OLE error telling you that the "Parameter is not optional".
>
>So, code like this will work:
>
>
>oInBox = oNameSpace.GetDefaultFolder( 6 )
>*** This will work if you have a folder called YadaYada
>oOtherFolder = oNameSpace.Folders( 1 ).Folders( "YadaYada" )
>oMsg = oInBox.Items( 1 )
>oCrap = oMsg.Move( oOtherFolder )
>
>
>However, this syntax will give you the ole error:
>
>oMsg.Move( oOtherFolder )
>
>The point being that you must have oCrap for this to work (as I said before, at least in OL2K which is where I tested this)
>
>HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform