OL2002: NoteItem.Move Actually Copies Item (292180)



The information in this article applies to:

  • Microsoft Outlook 2002

This article was previously published under Q292180

SYMPTOMS

You use the Move method on a NoteItem object, but the item is copied instead of moved.

WORKAROUND

As a workaround, delete the original item after you use the Move method. For example:
oNoteItem.Move oDestFolder
oNoteItem.Delete
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

This problem does not occur with other types of items, such as contacts or mail messages.

Steps to Reproduce Problem

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
  1. In your default Notes folder make sure you have at least one note item. Otherwise you will receive the following error when running the code below:
    Array index out of bounds.
  2. Create a subfolder of your Inbox called Test. When creating the folder, make sure to specify that it contains Notes.
  3. On the Tools menu, point to Forms and then click Design a Form. Click to select Message.
  4. Click the P.2 tab.
  5. On the Form menu, Click Control Toolbox.
  6. From the Control Toolbox, drag a Command button to your new form.
  7. On the Form menu, click View Code, enter the following Visual Basic Scripting Edition (VBScript) code and then close the Script Editor:
    Sub CommandButton1_Click()
    
       Set oNS = Application.GetNameSpace("MAPI")
    
       ' Set a reference to the Notes folder
       Set oFldSrc = oNS.GetDefaultFolder(12)
    
       ' Set a reference to the Test folder
       Set oFldDest = oNS.GetDefaultFolder(6).Folders("Test")
    
       ' Reference the first note in the folder
       Set oNoteItem = oFldSrc.Items(1)
    
       ' Move the note.
       oNoteItem.Move oFldDest
    
    End Sub
    					
  8. On the Form menu, click Run this Form.
  9. Click CommandButton1 on the P.2 tab.
The note will be copied to the Test folder, but will still exist in the default Notes folder.

Adding oNoteItem.Delete under the oNoteItem.Move oFldDest line will delete the item from the originating folder and simulate a move action.

REFERENCES

For additional information about available resources and answersto commonly asked questions about Microsoft Outlook solutions, click the article number below to view the article in the Microsoft Knowledge Base:

287530 OL2002: Questions About Custom Forms and Outlook Solutions


Modification Type:MajorLast Reviewed:6/23/2005
Keywords:kbbug kbnofix KB292180