Update a configure timeline dialog box programatically

R

Robert

I am dropping a embedded timeline on to a drawing and I want to
programatically update the configure timeline dialog box programatically. Is
there a way to have the document stencil have an embedded timeline that
already has the dates in it so the configure timeline dialog box does not
come up? Any ideas? Thanks
 
A

Al Edlund

try something like this,
al

'
' since we are going to call these from data recordsets we can use
' properties to cut down on the code
'
Public Sub InsertCylindricalTimeLine()

' user.displaybe 0/1 begin and end dates of timeline
' user.displayintm 0/1 interim markers
' user.autoupdate 0/1 update markers (milestones, intervals)
' user.displayIntmdates 0/1 dates on interim ticks

' user.visShapeType = 10

' prop.visType
' prop.visBeginDate
' prop.visEndDate

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 dblEndDate As Double
dblEndDate = CDbl(ThisDocument.tlEndDate)
If dblEndDate = 0 Then Exit Sub

If dblEndDate <= dblBeginDate Then Exit Sub


Set visDoc = Application.Documents.Item("TIMELN_U.VSS")
Set visMaster = visDoc.Masters.ItemU("Cylindrical timeline")
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.visbegindate", False) = True Then
Set visCell = visTL.Cells("user.visbegindate")
visCell.FormulaU = dblBeginDate
End If

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

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