Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

edit text field in shape from code.

Status
Not open for further replies.

unkajah

IS-IT--Management
May 28, 2007
1
Hello Everyone, I Have spent days trying to get this to work with no luck, I must be missing somthing very basic, and just cant figure it out on my own.

I have a little vb.net program I wrote, that takes a list of parts from a database, and for each part, gets a file name and opens that drawing and prints it.

works fine. the next step is to have the program put a header on the drawing with the "Lot Number" "Part Number" "QTY" etc.

so I have created a stencil, a MasterShape, and my program can drop this shape onto the drawing. the problem is getting a text fields to work is my problem.

I can edit this master (from the stencil) and create a few text boxes it seems I can create custom properites for Each text box seperatly (then insert a field in the text box), but not reference the master shape's properties. the scope is seperate on every item on the page.


How should I be going about this?

I really want to have a shape I can dump on my drawing in code and set the properties, print the drawing, and go to the next

the end resule in psydo code would be:

vshape.lotnumber = "1234"
vshape.qty ="100"

so can I create a master that has a set of properites, then draw some text boxes and assoiciate the boxes values to those properties, and then access them from code?

Thank you very much!

-John
 
You can do something like
Dim stencil As Visio.Document
Dim mstCircle As Visio.Master
Dim shpObj as Visio.Shape
Set stencil = ThisDocument.Application.Documents.Open("Blocks Raised.vss")
Set mstCircle = stencil.Masters("Circle")
shpObj = ActivePage.Drop(mstCircle, 4, 5)
shpObj.Cells("Prop.FirstCustomProperty.Value") = 4
End Sub

John... Visio MVP - Visio.MVPs.org
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top