Microsoft Knowledge Base Email Alertz

(113768) - In Microsoft Project, when you use the OrganizerMoveItem method in a macro to copy an item in the Organizer dialog box to a project, a dialog box appears asking if you want to replace the existing item if an item with the same name exists in the...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 113768 - Last Review: September 18, 2011 - Revision: 7.0

Dialog box interrupts macro using OrganizerMoveItem method in Project

This article was previously published under Q113768

SYMPTOMS

In Microsoft Project, when you use the OrganizerMoveItem method in a macro to copy an item in the Organizer dialog box to a project, a dialog box appears asking if you want to replace the existing item if an item with the same name exists in the project file you are copying to.

CAUSE

If an item with the same name exists in the project you are copying the item to, you are prompted to either replace the existing item, cancel the copy, or rename the item you are copying. The OrganizerMoveItem method does not have an argument that you can use to indicate that you want to replace an existing item with the same name.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements.
To avoid receiving this confirmation dialog box when you copy items from one project to another, use the Alerts method with the Show argument value equal to False in your macro before the OrganizerMoveItem command. When you use the Alerts False command in a macro, no dialog boxes appear while the macro is running, and the default button in any dialog box that would appear is chosen.

For example, the following macro copies the Gantt Chart in Project1 to GLOBAL.MPT without displaying a dialog box asking if you want to replace the Gantt Chart in GLOBAL.MPT:
   Sub Move_View
      Alerts False
      OrganizerMoveItem Type:=0, FileName:="Project1", _
         ToFilename:="GLOBAL.MPT", Name:="Gantt Chart"
   End Sub
				
Because the default button in the dialog box that appears asking if you want to replace the Gantt Chart in GLOBAL.MPT is Yes, the macro replaces the Gantt Chart in GLOBAL.MPT with the Gantt Chart in Project1.

Note that when you use the OrganizerDeleteItem method in a macro to delete an item in the Organizer dialog box, a dialog box does not appear asking if you want to delete the item.

REFERENCES

For more information about the OrganizerMoveItem method, choose the Search button in the Visual Basic Reference and type:
OrganizerMoveItem Method

APPLIES TO
  • Microsoft Office Project Professional 2007
  • Microsoft Office Project Standard 2007
  • Microsoft Office Project Professional 2003
  • Microsoft Office Project Standard 2003
  • Microsoft Project 2002 Professional Edition
  • Microsoft Project 2000 Standard Edition
  • Microsoft Project 98 Standard Edition
  • Microsoft Project 4.1 Standard Edition
  • Microsoft Project 4.0 Standard Edition
  • Microsoft Project 4.0 for Macintosh
  • Microsoft Project Professional 2010
  • Microsoft Project Standard 2010
  • Microsoft Project 2002 Standard Edition
Keywords: 
kbmacro kbprb kbusage KB113768
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

k.selvambikai - kselvambikai NOSPAM-AT-NOSPAM gmail.com Report As Irrelevant  
Written: 11/13/2005 11:19 PM
hi,Like this I need not want confirmation dialog box while saving data to web.cofig in asp.net.how should I prevent this?It automatically takes yes and save values to web.configIt is very urgent and important please give the idea clearly and quickly for me. Thanks in advance