Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetObject, AddObject
Message
From
03/11/2007 11:12:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01266340
Message ID:
01266393
Views:
9
>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

I don't have it installed to test. This might work if MS Project is not behaving like MS Word:

THISFORM.box001.oProjx.Object.application.fileopen('c:\temp\matrix.mpp')

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform