Microsoft KB Archive/218168

From BetaArchive Wiki

Article ID: 218168

Article Last Modified on 1/24/2007



APPLIES TO

  • Microsoft Outlook 97 Standard Edition



This article was previously published under Q218168


SYMPTOMS

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

RESOLUTION

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. Open a new mail message and on the Tools menu, click Design Outlook Form.
  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 Design Outlook Form to switch the form to run mode.
  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 more information about creating solutions with Microsoft Outlook 97, please see the following articles in the Microsoft Knowledge Base:

166368 OL97: How to Get Help Programming with Outlook


170783 OL97: Q&A: Questions About Customizing or Programming Outlook



Additional query words: OutSol OutSol97

Keywords: kbbug kbnofix kbprogramming KB218168