[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to generate simple xml code to import into visio

Posted on 2010-08-24
4
Medium Priority
?
1,555 Views
Last Modified: 2012-06-21
Hi Experts,

I want my VB-Application to generate xml-Code that later on can be opened in Visio 2003.
This as about orga charts, so in my xml code I need to generate the shapes that are necessary for an orga chart.
When I create an orga chart in Visio 2003 and export it to an vsx file, I get a very large file, even if I set the PreviewDocument property off.

What I need is a rather simple examle of an xml file that contains the most important properties like how to create the 3 or 4 different shapes for an ograchart and connections between them. An overview over the "syntax" for the most common features would be greate, too.

Thanks for your help!

Kai

0
Comment
Question by:Lupo09
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:arch-itect
ID: 33512703
Here is the reference (wait for it to load completely) :

http://msdn.microsoft.com/en-us/library/Aa218408
http://msdn.microsoft.com/en-us/library/aa830812(v=office.10).aspx

Here are some MSXML utilities that might be helpful in generating xml from an xml schema

http://msdn.microsoft.com/en-gb/data/bb190600.aspx
0
 
LVL 31

Accepted Solution

by:
Scott Helmers earned 2000 total points
ID: 33520778
You're right that the amount of code produced by Visio's Save as XML is pretty absurd. In stark contrast to that code, it takes a surprisingly small amount of XML to actually create a Visio drawing, so your question is very appropriate.

Chris Roth (aka "The Visio Guy") made a presentation on this subject at the 2006 Visio Conference and though it was four years ago, the content is still very relevant. His slides and code samples are available at the second link.

One other thought -- unless you specifically need XML for some other reason, are you aware that your code can run the Org Chart wizard directly? This is especially useful if the data from which you want to create the org chart already exists in SQL or Excel or various other data sources. This article from Microsoft describes the command line parameters and if you'd like to see an example with sample code, I co-wrote an article about automating the creation of org charts, albeit for a somewhat unique purpose.

Regards,
Scott
 
0
 

Author Comment

by:Lupo09
ID: 33534329
Hi Folks,
the links provided by arch-itect helped gathering valuable information on how to deal with XML-and Visio, thanks!
Your approach, Scott, to built up an orga chart using the Excel Import Wizard within an VBA script is a really great idea! I do not really rely on XML, but I would prefer it, because I could have my Application create the XML-File regardless if Visio or Excel is installed.
I think, I will go for your solution and export my Orga Data to Excel, create a Visio Object within my App and use your example code to import the Orga Data using the Visio Wizard. Users who would use this function can be told to have Visio and Excel installed.

Nevertheless, If anybody has an example of an tiny little xml-file that can be opened in Visio as an Orga Chart, I would appreciate that very much. (I was experimenting for  hours and don't seem to come to a solution...)

Thanks a lot to all of you!

Kai
0
 

Author Closing Comment

by:Lupo09
ID: 33556083
Although my approach was another one, your solution is a very elegant way to come to the same result.

Thanks,

Kai
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Starting up a Project
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question