Freigeben über


ActiveProject Property

Contains an object reference to the Project object for the currently active Project Manager window. Read-only at design time and run time.

Object.ActiveProject

Remarks

The ActiveProject property contains an object reference to the Project object for the foremost Project Manager window when more than one Project Manager window is open. An error is generated if you attempt to access the ActiveProject property when a Project Manager window isn't open.

For more information about projects, see Project Manager Hooks and Application Development and Developer Productivity.

Example

The following example uses the ActiveProject property to get a count of Reports and Labels in an active project. If the MyApp project does not exist, it will be created when MODIFY PROJECT is executed.

MODIFY PROJECT myApp NOSHOW NOWAIT 
nRptsLbls=0
FOR EACH oFile IN _VFP.ACTIVEPROJECT.FILES
   IF INLIST(oFile.Type, "R", "B")  && Report and Label
      nRptsLbls=nRptsLbls+1
   ENDIF
ENDFOR

See Also

File Object | Files Collection | Project Object | ProjectHook Object | Projects Collection | Server Object | Servers Collection

Applies To: Application Object | _VFP System Variable