Setting the LineWeight on a cell through code will not refresh the shape

B

Brankie

I'm setting the LineWeight cell of a shape through code. It is
changing the value, but is not updating the shape. I can do this
manually through the right click menu with no problem. I do have the
updating turned on and the recalculating turned on.

Any ideas?
 
B

Bill K. [MSFT]

If the shapes are grouped you need to set the sub-shape line weights as
well.

Sub SetLineWeight(shp As Visio.Shape, lineWeightFormula As String)
Dim subShape As Visio.Shape

shp.Cells("LineWeight").FormulaU = lineWeightFormula

For Each subShape In shp.Shapes
SetLineWeight subShape, lineWeightFormula
Next subShape
End Sub


Hope this helps,
 
B

Brankie

Bill K. said:
If the shapes are grouped you need to set the sub-shape line weights as
well.

Sub SetLineWeight(shp As Visio.Shape, lineWeightFormula As String)
Dim subShape As Visio.Shape

shp.Cells("LineWeight").FormulaU = lineWeightFormula

For Each subShape In shp.Shapes
SetLineWeight subShape, lineWeightFormula
Next subShape
End Sub


Hope this helps,

--
Bill K.
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.



This works better... however I am changing the line thickness during
processing and returning the line thickness at the end of processing.
If I let the processing end without returning the line thickness...
then the line thickness will be changed when I give the user control
again.

How can I force the refresh? I've tried rotating the shape, doevents,
zoomin/out, etc.

Thanks!
 

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