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.