Re: Programmatically insert Visio pictures

Tech-Archive recommends: Speed Up your PC by fixing your registry



Not pretty, but a loop with something like the following would work:

Dim shp As Visio.Shape
Dim adn As Visio.Addon

Set adn = Visio.Addons("OrgC11")
'Loop thru your shapes
Set shp = Visio.ActivePage.Shapes("Assistant")
Visio.ActiveWindow.DeselectAll
Visio.ActiveWindow.Select shp, Visio.VisSelectArgs.visSelect
SendKeys "C:\Users\davidp\Pictures\anypicture.jpg{ENTER}", True
adn.Run "/cmd=InsertPicture"
'end loop

"Mark Mayle" wrote in message news:200712615184m_elyam@xxxxxxxxxxxx
I also need to programmatically insert pictures into my Visio (2007) org chart shapes (created with the wizard). Any idea how to do this? I cannot seem to find any information on how and where these are kept or how they can be accessed via the Visio object model. The reply above did not help me achieve this. Maybe I am missing something?

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com

.



Relevant Pages

  • Re: TextRange.Select: Invalid request
    ... >> (Newbie with Powerpoint and first posting here) ... For Each sld In Application.ActivePresentation.Slides ... For Each shp In sld.Shapes ... >> execution does loop infinitely on the last para mark in the first ...
    (microsoft.public.powerpoint)
  • Re: Loop gone crazy
    ... > Can someone tell me why this loop accepts any value rather than the set ... > Dim shp as Long ... > Dim shpSw as Integer ...
    (microsoft.public.excel.misc)