Visio Draw Line In VB.NET

  • Thread starter frank.reid-robertson
  • Start date
F

frank.reid-robertson

Hi I am trying to write a vb.net application that takes data from a
flat file which has x1,y1,x2,y2 coordinates in it to draw a image in
visio.

How do i draw lines in visio using vb.net

visio version is 2007
vb.net version 2005

Please Help.
 
D

David Parker

The Page object has a DrawLine method, but you may want to us the
DrawPolyLine method
 
F

frank.reid-robertson

The Page object has a DrawLine method, but you may want to us the
DrawPolyLine method









- Show quoted text -


Could you supply a sample use of the method
I have been looking at the sdk documentation with no success
 
J

John

Hello Frank,

This is a VBA example of the DrawLine method that David mentioned and if you
want to use DrawPolyLine then just have a look it up in Visio's help file.

Sub DrawLine()

Dim pag As Visio.Page
Dim shp As Visio.Shape
Dim dblXBegin As Double
Dim dblXEnd As Double
Dim dblYBegin As Double
Dim dblYEnd As Double

dblXBegin = 1
dblYBegin = 1
dblXEnd = 3
dblYEnd = 3

Set pag = Application.ActivePage
Set shp = pag.DrawLine(dblXBegin, dblYBegin, dblXEnd, dblYEnd)

End Sub

Hope that helps.

Best regards

John
 
F

frank.reid-robertson

Hello Frank,

This is a VBA example of theDrawLinemethod that David mentioned and if you
want to use DrawPolyLine then just have a look it up inVisio'shelp file.

SubDrawLine()

Dim pag AsVisio.Page
Dim shp AsVisio.Shape
Dim dblXBegin As Double
Dim dblXEnd As Double
Dim dblYBegin As Double
Dim dblYEnd As Double

dblXBegin = 1
dblYBegin = 1
dblXEnd = 3
dblYEnd = 3

Set pag = Application.ActivePage
Set shp = pag.DrawLine(dblXBegin, dblYBegin, dblXEnd, dblYEnd)

End Sub

Hope that helps.

Best regards

John







- Show quoted text -

This is all fine in vba but how do you translate this in to vb.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top