changing timeline shape interim markers

T

Thomas Z.

I'm trying to change the timeline shapes in Visio 2007. In particular I want
the text associated with interim markers to be differently placed. E.g.
displaying months only, I want the month name appearing between 2 markers and
not below one marker. How can I accomplish this. I tried to modify
user-defined cell values in the shape sheet but did not succeed.
Any support is appreciated.
 
P

Philippe C.

This looks bad, real bad.
I could format the data in Excel = [$-409]mmmm
But here you cannot customize the format. Neither do I see something in the
Shapesheet.


=RUNADDONWARGS("ts","/cmd=6")
Means as much as "Sorry, it is in the dll".
 
A

Al Edlund

It's got to be done with code. The timeline shapes are grouped so you might
want to use something like this..
al


'
' some experimenting with making sure the scale is appropriate to
' the timeline
'
'Const mskDate As String = "{{M/d/yyyy}}"
'Const mskHour As String = "{{HH:mm}}"
'Const mskBEHour As String = "{{M/d/yyyy h:mm am/pm}}"

Private Sub SetTimelineScales()

Dim visCell As Visio.Cell
Dim strCellName As String
Dim visShape As Visio.Shape
Dim strMaster As String
Dim visCellBegin As Visio.Cell
Dim dblBegin As Double
Dim visCellEnd As Visio.Cell
Dim dblEnd As Double
Dim visCellScale As Visio.Cell
Dim visCellMask As Visio.Cell
Dim visCellBEMask As Visio.Cell
Dim visMinorScale As Visio.Cell
Dim intMarker As Integer

On Error GoTo SetScale_err

Application.ActiveWindow.DeselectAll

For Each visShape In Application.ActivePage.Shapes
If visShape.Master Is Nothing Then GoTo DoNextShape
strMaster = visShape.Master.NameU
If strMaster = "Expanded timeline" _
Or strMaster = "Cylindrical timeline" Then

Application.ActiveWindow.Select visShape, 2

' first based on duration get a new scale
Set visCellBegin = visShape.Cells("user.visbegindate")
dblBegin = visCellBegin.ResultIU
If dblBegin = 0 Then
DoEvents
Exit Sub
End If

Set visCellEnd = visShape.Cells("user.visenddate")
dblEnd = visCellEnd.ResultIU

If dblEnd = 0 Then
DoEvents
Exit Sub
End If

If dblEnd <= dblBegin Then Exit Sub

' function returns an integer based on how long the timeline
is
' so that we can pick an appropriate time scale
intMarker = computeMarkers(visCellBegin.ResultIU,
visCellEnd.ResultIU)

' change the scale in the timeline
Set visCellScale = visShape.Cells("user.vistimescale")
visCellScale.Formula = intMarker

Set visMinorScale = visShape.Cells("user.visminortimescale")
visMinorScale.Formula = intMarker

' now change the mask for the time stamp
Set visCellMask = visShape.Cells("User.visIntmMask")
Set visCellBEMask = visShape.Cells("User.visBEMask")
If intMarker < 3 Then
visCellMask.Formula = StringToFormulaForString(mskHour)
visCellBEMask.Formula =
StringToFormulaForString(mskBEHour)
Else
visCellMask.Formula = StringToFormulaForString(mskDate)
End If

' call the addon so that the new data can be applied to the
shapes
'execTimelineAddon cmdCfgTimeline

Application.ActiveWindow.DeselectAll

DoNextShape: End If

Next visShape
Exit Sub

SetScale_err:
MsgBox "SetScaleFailed " & Err.Description


End Sub




Philippe C. said:
This looks bad, real bad.
I could format the data in Excel = [$-409]mmmm
But here you cannot customize the format. Neither do I see something in
the
Shapesheet.


=RUNADDONWARGS("ts","/cmd=6")
Means as much as "Sorry, it is in the dll".



Thomas Z. said:
I'm trying to change the timeline shapes in Visio 2007. In particular I
want
the text associated with interim markers to be differently placed. E.g.
displaying months only, I want the month name appearing between 2 markers
and
not below one marker. How can I accomplish this. I tried to modify
user-defined cell values in the shape sheet but did not succeed.
Any support is appreciated.
 

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