Is there a way to display the Last Edited date of each page

M

Mike S

I have a drawing with several pages that will be edited at different times.
Is there any way to display the last edited date on each page individually?
The Edited date field is for the entire file.
 
J

John... Visio MVP

Mike S said:
I have a drawing with several pages that will be edited at different times.
Is there any way to display the last edited date on each page
individually?
The Edited date field is for the entire file.


So you want each page to have it's own edited date?

All dates are set at the page level, but it is possible to create a custom
property (Shape Data) at the page level and then create a menu item that
when clicked, that custom property is updated with the current time stamp.

John... Visio MVP
 
M

Mike S

That would do the trick. When I create a custom property with the date, it
displays in the shapesheet as a DATETIME function, (ie =DATETIME(40093)) How
do I reference the current date in code, so it is converted to the DATETIME
format?
 
J

John... Visio MVP

This is a quick attempt, but you could add the following to the ThisDocument
module

Option Explicit

Private Sub Document_BeforeSelectionDelete(ByVal Selection As IVSelection)
UpdateDateReviewed
End Sub

Private Sub Document_PageAdded(ByVal Page As IVPage)
UpdateDateReviewed
End Sub

Private Sub Document_ShapeAdded(ByVal Shape As IVShape)
UpdateDateReviewed
End Sub

Private Sub Document_ShapeExitedTextEdit(ByVal Shape As IVShape)
UpdateDateReviewed
End Sub

Sub UpdateDateReviewed()

Dim vsoShape As Visio.Shape
Dim intPropRow As Integer

Set vsoShape = ActivePage.PageSheet

If vsoShape.CellExists("Prop.DateRevised", False) = False Then
intPropRow = vsoShape.AddRow(visSectionProp, visRowLast, visTagDefault)
vsoShape.CellsSRC(visSectionProp, intPropRow,
visCustPropsLabel).FormulaU = """DateRevised"""
vsoShape.CellsSRC(visSectionProp, intPropRow,
visCustPropsValue).RowNameU = "DateRevised"
vsoShape.CellsSRC(visSectionProp, intPropRow, visCustPropsType).FormulaU
= "5"
vsoShape.CellsSRC(visSectionProp, intPropRow,
visCustPropsFormat).FormulaU = ""
vsoShape.CellsSRC(visSectionProp, intPropRow,
visCustPropsPrompt).FormulaU = ""
vsoShape.CellsSRC(visSectionProp, intPropRow,
visCustPropsValue).FormulaU = ""

End If

vsoShape.Cells("Prop.DateRevised") = Format(Now(), "00000.00000")

End Sub

John... Visio MVP
 

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