PRJ98: How to Change the Default Working Directory (175026)



The information in this article applies to:

  • Microsoft Project 98 for Windows

This article was previously published under Q175026
IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

SUMMARY

This article describes how to change the default directory that Microsoft Project 98 uses when you open and save files.

MORE INFORMATION

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. Use either of the following two methods to change the default directory that Microsoft Project uses when you open and save files.

Method 1: Create a Macro


  1. In Microsoft Project, on the Tools menu, point to Macro, then Visual Basic Editor.
  2. In the Project Explorer, expand ProjectGlobal (Global.mpt)
  3. Expand Microsoft Project Objects.
  4. Double click ThisProject (Global.mpt).
  5. In the Code window, in the Object drop down, click Project.
  6. Between the following lines:
    Private Sub Project_Open(ByVal pj As MSProject.Project)
    End Sub
    						
    add this line:
    Auto_Open
    						
  7. On the Insert menu, click Procedure.
  8. In the Name: box, type Auto_Open.
  9. In Type, click Sub.
  10. In Scope, click Public. Click OK.
  11. Between the following lines:
    Public Sub Auto_Open()
    
    End Sub
    						
    add this line:
    ChDrive "c:\"  
    ChDir "c:\My Documents"
    						
    NOTE: c:\My Documents is the new default directory for Project. It can be replaced with an alternate folder name. Note that the drive specified for ChDrive must match the drive specified for ChDir.
  12. On the File menu, click Save Global.mpt.
  13. On the File menu, click Close and Return to Microsoft Project.
  14. In Microsoft Project, on the File menu, click Exit.
    Each time Microsoft Project is started, the default directory will be changed to the location specified in the macro.


Method 2: Modify the Windows Default Directory in the Registry



WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it.

NOTE: The following steps change the default working directory in Microsoft Windows. Microsoft Access, Microsoft Excel, Microsoft Power Point, and Microsoft Word allow you to use default directories other than the Windows default directory.

To set the default working directory, follow these steps:

  1. On the Windows Start menu, click Run.
  2. In the Open box, type "regedit" (without the quotation marks). Click OK.
  3. In the Registry Editor, select the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\ Explorer\ User Shell Folders
  4. In the right pane, double-click Personal.
  5. In the Value Data box, type the path you want to use for the default working directory. For example, type "C:\My Documents" (without the quotation marks).
  6. Click OK.
  7. On the Registry menu, click Exit.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbdtacode kbhowto kbProgramming KB175026