Display shapes in a custom window

Started by nessim, July 08, 2008, 03:47:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nessim

Hi Guys,

I've been trying hard to find a way to display shapes in a custom window (visAnchorBarAddon). I'd like to have a window that displays shapes depending on settings provided by the user in a form. As it should be a preview, I don't want to drop the shapes onto my active drawing but rather drop and modify the shapes in my preview window during runtime.

The problem is that I can't find a suitable solution to draw shapes in a visAnchorBarAddon window. I created a form and set it as the child window of my visAnchorBarAddon window, but forms don't accept shapes neither. Using a Microsoft Web Browser Control seems only to allow navigating to an existing document but not giving it an object programatically.

Does anyone have a solution or a hint how I might do that?

Thanks alot,
Nessim

Lars-Erik

Not sure if this fits your needs, but it might be a posibility:

Application.ActiveWindow.Page.OpenDrawWindow
    Dim vsoPage1 As Visio.Page
    Set vsoPage1 = ActiveDocument.Pages.Add
    vsoPage1.Name = Rnd() & "Page"
    vsoPage1.Background = True
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageWidth).FormulaU = "297 mm"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageHeight).FormulaU = "210 mm"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageShdwType).FormulaU = "1"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowRulerGrid, visXGridDensity).FormulaU = "0"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowRulerGrid, visYGridDensity).FormulaU = "0"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowRulerGrid, visXGridSpacing).FormulaU = "3 mm"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowRulerGrid, visYGridSpacing).FormulaU = "3 mm"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOJumpStyle).FormulaForceU = "1"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPrintProperties, visPrintPropertiesOnPage).FormulaU = "1"
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPrintProperties, visPrintPropertiesPageOrientation).FormulaU = "2"
    vsoPage1.PageSheet.CellsSRC(visSectionUser, 0, visUserValue).FormulaForceU = ""
    vsoPage1.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageUIVisibility).FormulaU = 1


The thought here is to create a second view, and open a new background page (with random name)
Drop the shape here (not in the code yet) play around with it as pleased, and then when the user is done you could drop it on the main page, and close the second view, and ofcourse remove the hidden background again (also not in the code yet)
You get the idea... might this be a solution to what you want? or do you really need to keep the shape out of the document until the user is done editing it ?

I know its not an awnser to your question, but it might be a different road to the same point?

(edit the above text and remove page settings as you want ofcourse)

- Lars