Tim,
Creating Visio.Application is going to create a running instance of Visio. If you want to host a Visio drawing in a form you have to drop an instance of OLE container and select "Create new", then Visio Document.
Although most times I've seen Visio automation it's done from the seperate Visio instance.
>How do I add a visio document to a FoxPro form and run the same type of Example code below. I have tried every thing I know. The following code opens an external visio document and draws a line.
>
>I would like insert the visio document directly onto a foxpro form and automate the document just like the code below.
>
>I have tried to use ole bound contols but I do not have access to all these methods and properties.
>
>I have seen examples in visual basic. Maybe it can not be done in FoxPro. I thought FoxPro 8 could do anything VB could?
>
>
>Example code:
>----------------------------
>PUBLIC AppVisio, DocsVisio, AppPage,DocPage, MasterDoc, MasterObject, RectObject, WindowObject
>appVisio = CREATEOBJECT("Visio.application")
>DocsVisio = AppVisio.Documents
>** Creates a pointer to a new visio document based on the Rumbaugh method
>
>VisioDoc = DocsVisio.Add ("basic.vst")
>** These are two references to the same page.
>AppPage = AppVisio.ActivePage
>DocPage = VisioDoc.Pages(1)
>? AppPage.Name
>? DOCPAGE.Name
>DocPage.Name = "Demonstration for Conference"
>
>** Now Pages Contain SHAPES...
>** SHAPES can either be drawn outright using the DrawLine, DrawOval and DrawRectangle Methods
>DocPage.DrawLine(1,9,3,10)
>---------------------------------