Expanded timeline

R

Robert

How do I add text to an expanded timeline shape using code (VBA for example).
What I am after is the cell name that I would need to use. Thanks
 
P

Paul Herber

How do I add text to an expanded timeline shape using code (VBA for example).
What I am after is the cell name that I would need to use. Thanks

you need to write to the shape's text cell.
However, this shape is protected against having text written to it,
and quite well protected !
You will also need to
a. remove the LockTextEdit protection
b. set cell IsTextEditTarget in the Group properties
 
S

SteveM

you need to write to the shape's text cell.
However, this shape is protected against having text written to it,
and quite well protected !
You will also need to
a. remove the LockTextEdit protection
b. set cell IsTextEditTarget in the Group properties

Robert,

Paul is a much more elegant about his solutions than I. What a man
with simple pedestrian sensibilities like mine would do, would be to
add a new Shape Data field to the Expanded Timeline shape that
contains the text you want to display. And select a text Data Graphic
to display it. That process can be managed with simple code.

SteveM
 
A

Al Edlund

This is some stuff that I use. I keep some globals in the document code so
the different modules can get to them.
al


Public Sub InsertCylindricalInterval _
(Optional ByVal blnDate As Boolean = False, _
Optional ByVal blnText As Boolean = False, _
Optional ByVal intColor As Integer = visYellow)

' this is a group with three components
' there are two text boxes, one with a single text line and one with two
' the two text line object are the dates
' the single text line is the description

' prop.visType
' prop.visPercent
' prop.visName
' prop.visIntervalBegin
' prop.visIntervalEnd

' user.visShapeType = 11


Dim visApp As Visio.Application
Set visApp = Application

Dim visDoc As Visio.Document
Dim visMaster As Visio.Master
Dim visTL As Visio.Shape

Dim dblBeginDate As Double
dblBeginDate = CDbl(ThisDocument.tlStartDate)
If dblBeginDate = 0 Then Exit Sub
Dim dblBeginTime As Double
dblBeginTime = CDbl(ThisDocument.tlStartTime)

Dim dblEndDate As Double
dblEndDate = CDbl(ThisDocument.tlEndDate)
If dblEndDate = 0 Then Exit Sub
If dblEndDate < dblBeginDate Then Exit Sub
Dim dblEndTime As Double
dblEndTime = CDbl(ThisDocument.tlEndTime)

Set visDoc = Application.Documents.Item("TIMELN_U.VSS")
Set visMaster = visDoc.Masters.ItemU("Cylindrical interval")
visApp.AlertResponse = 1

Set visTL = visApp.ActiveWindow.Page.Drop _
(visMaster, _
ThisDocument.tlPinX, _
ThisDocument.tlPinY)


'
' put the dates into the timeline
'
Dim visCell As Visio.Cell

If visTL.CellExists("user.visintervalbegin", False) = True Then
Set visCell = visTL.Cells("user.visintervalbegin")
visCell.FormulaU = dblBeginDate + dblBeginTime
End If

If visTL.CellExists("user.visintervalend", False) = True Then
Set visCell = visTL.Cells("user.visintervalend")
visCell.FormulaU = dblEndDate + dblEndTime
End If

If visTL.CellExists("prop.visname", False) = True Then
Set visCell = visTL.Cells("prop.visname")
visCell.Formula =
StringToFormulaForString(ThisDocument.tlDescription)
End If


' this is the transparency value
' turn off the date leave the description
ToggleIntervalVisibility visTL, blnDate, blnText

setIntervalColor visTL, intColor

visApp.AlertResponse = 0

End Sub
 

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