Hi Mike,
First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to dynamically generate
Visio document at ASP.NET Server side.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.
Firstly to utilize the Visio function, we do need the Visio application
installed and automation the Visio application to do the job we do
manually. This is called Automation.
But Server side Automation of Office products is not support which have
many underlying problem.
257757 Considerations for server-side Automation of Office
http://support.microsoft.com/default.aspx?scid=kb;EN-US;257757
If we want to generate Visio document programming,, we should use client
side automation, e.g. a Winform application.
Here is a link for your reference.
305199 How to automate Visio with Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;305199
Actually we can use the Macro recording function to track the code used to
do some manually job programming.
e.g.
1. Open a Visio application and new a Drawing
2. Press Tools/Macro/Record New Macro
3. And then we can do our job manually
e.g. drop two shape and a connector onto the drawing and connect them
4. Stop Macro recording
5. Press Atl+F11 to view the macro recorded.
Here is what I got.
Sub Macro1()
Application.Windows.ItemEx("Drawing1").Activate
Application.ActiveWindow.Page.Drop
Application.Documents.Item("BASFLO_M.VSS").Masters.ItemU("Process"),
3.838583, 9.84252
Application.Windows.ItemEx("Drawing1").Activate
Application.ActiveWindow.Page.Drop
Application.Documents.Item("BASFLO_M.VSS").Masters.ItemU("Process"),
3.838583, 7.775591
Application.Windows.ItemEx("Drawing1").Activate
Application.ActiveWindow.Page.Drop
Application.Documents.Item("BASFLO_M.VSS").Masters.ItemU("Dynamic
connector"), 2.165354, 8.858268
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Size Object")
Dim vsoCell1 As Visio.Cell
Dim vsoCell2 As Visio.Cell
Set vsoCell1 =
Application.ActiveWindow.Page.Shapes.ItemFromID(3).CellsU("EndX")
Set vsoCell2 =
Application.ActiveWindow.Page.Shapes.ItemFromID(2).CellsSRC(7, 3, 0)
vsoCell1.GlueTo vsoCell2
Application.EndUndoScope UndoScopeID1, True
Dim UndoScopeID2 As Long
UndoScopeID2 = Application.BeginUndoScope("Size Object")
Dim vsoCell3 As Visio.Cell
Dim vsoCell4 As Visio.Cell
Set vsoCell3 =
Application.ActiveWindow.Page.Shapes.ItemFromID(3).CellsU("BeginX")
Set vsoCell4 =
Application.ActiveWindow.Page.Shapes.ItemFromID(1).CellsSRC(7, 2, 0)
vsoCell3.GlueTo vsoCell4
Application.EndUndoScope UndoScopeID2, True
End Sub
We can easy convert the code to VB.NET, because in nature we are
programming against the Visio Object Modal.
In the SDK, it also involved the Save As Web Page API, which is also the
automation behavior which is to do the Save As Web Page menu command
programming.
In a summary, this solution is not proper to run at ASP.NET server side due
to the KB above.
Also ASP.NET can use .NET buildin funtion to create bitmap on the fly and
show to the client. So if your scenario is not complex, maybe this is an
alternative.
Create Snazzy Web Charts and Graphics On the Fly with the .NET Framework
http://msdn.microsoft.com/msdnmag/issues/02/02/ASPDraw/
If you have any concern, please feel free to let me know.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.