Microsoft KB Archive/316988

= PRB: &quot;Parameter Not Optional&quot; Error Message When You Use Move Method in Outlook 2000 =

Article ID: 316988

Article Last Modified on 5/14/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition
 * Microsoft Visual FoxPro 7.0 Service Pack 1

-



This article was previously published under Q316988



SYMPTOMS
If you are automating Microsoft Outlook 2000 from Visual FoxPro 7.0, when you call the Move method of a folder item, you may receive the following error message:

OLE error code 0x8002000f: Parameter not optional.



RESOLUTION
To resolve this problem in Visual FoxPro 7.0, use one of the following methods:   Preface the Move method call with an equal sign (=) character. For example: =loFldr1.items(i).Move(loFldr2)  Upgrade to Microsoft Outlook 2002.

NOTE: This problem can occur with methods other than the item Move method. Apply the equal sign resolution in those scenarios to resolve the problem.



Steps to Reproduce the Behavior
  Run the following code from a program (.prg) file in Visual FoxPro 7.0 or Visual FoxPro 7.0 Service Pack 1 (SP1): loApp = CREATEOBJECT(&quot;Outlook.Application&quot;) loSpace = loApp.GetNameSpace(&quot;MAPI&quot;) loFldr1 = loSpace.GetDefaultFolder(olFolderInbox) loFldr2 = loSpace.GetDefaultFolder(olFolderDrafts) FOR i = 1 to 3 *!* Following line fails with the message: *!* Program Error - OLE error code 0x8002000f: Parameter Not Optional loFldr1.items(i).Move(loFldr2) && Move to &quot;Drafts&quot; folder ENDFOR RETURN  This program moves three messages from your Outlook Inbox to your Drafts folder. When the program has completed, move the messages back manually.
 * 1) DEFINE olFolderDrafts   16
 * 2) DEFINE olFolderInbox     6
 * !* Try to move 3 messages into the Drafts folder

Notice that you receive the error message that is listed in the &quot;Symptoms&quot; section. This error occurs on the loFldr1.items(i).Move(loFldr2) line.  To resolve this problem, preface the call to the Move method with an equal sign (=): =loFldr1.items(i).Move(loFldr2) </li></ol>

Additional query words: equals automation Office

Keywords: kbcodesnippet kbprb KB316988

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.