Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetObject, AddObject
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
GetObject, AddObject
Miscellaneous
Thread ID:
01266340
Message ID:
01266340
Views:
51
I am trying to load MS Project (2000) into a form, however, I also want to load a particular MPP file.

I can get the file but not get it into the container else I can get it into the container but without the loaded file.

If I use AddObject then I can manipulate the Object on the form, however, GetObject I can actually manipulate the commands of the object.


Code Sample:
&& Object Container THISFORM.box001

THISFORM.box001.AddObject('oProjx','olecontrol', 'MSPROJECT.project.9')

survtemp='c:\temp\matrix.mpp'

&& THESE DOES NOT WORK
&& THISFORM.box001.fileopenex(survtemp)
&& THISFORM.box001.application.fileopenex(survtemp)
&& THISFORM.box001.oProjx.fileopen()
&& THISFORM.box001.oProjx.application.fileopen()

THISFORM.box001.Height			= 360
THISFORM.box001.oProjx.Height		= 360
THISFORM.box001.Width			= 732
THISFORM.box001.oProjx.Width		= 732

THISFORM.box001.Visible	= .t.
THISFORM.box001.oProjx.Visible	= .t.

THISFORM.box001.oProjx.DoVerb (-1)

THISFORM.box001.oProjx.TASKS.ADD('HELLO')
THISFORM.box001.oProjx.TASKS.ADD('GOODBYE!')

THISFORM.box001.oProjx.application.ActiveProject

THISFORM.SHOW

&& Whilst I cannot get the Project file I want : I do get the Project in my container
============================================================

&& This get the correct MS Project File but I cannot get into my Object container
&& Thisform.box001

mbudvar = GETOBJECT('', 'MSPROJECT.project.9')

survtemp='c:\temp\matrix.mpp'
mbudvar.application.fileopen(survtemp)

prjx = mbudvar.application.ActiveProject

mbudvar.application.visible = .t.
Can anyone assist in getting mbudvar into the container
Obviously, missing a simple but forgotten command.

Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform