I'm struggling with recreating the examples found here in help file in VBA. Can anyone share a small piece of code or words of advice to get me passed a bump?
I can't seem to find out how to return the ppoRethistory value (In VBA) for this portion of the "GetHistories_Click" Subroutine.
Dim ppoRethistory() As EdmHistoryItem = Nothing
history.GetHistory(ppoRethistory, EdmHistoryType.Edmhist_FileVersion)
Ultimately, I'm writing a status report and I'm being asked to find the Latest workflow state that the file has been in. Think of it like a one-way check-valve even if the file was sent back to a WIP state while in review, it should report the review state. Getting the current state is easy and doesn't need to go through this history comparison.
Kevin, it is tricky doing this in VBA. Found this method that works.
Dim vault As IEdmVault8
Dim history As IEdmHistory2
Dim aFile As IEdmFile5
Dim ppoRethistory() As EdmHistoryItem
Dim vHistory As Variant
Dim i As Integer
Set vault = New EdmVault5
vault.LoginAuto "PDMtest", 0
Set aFile = vault.GetFileFromPath("d:\PDMtest\New Microsoft Excel Worksheet.xlsx")
Set history = vault.CreateUtility(EdmUtility.EdmUtil_History)
history.AddFile aFile.ID
history.GetHistory ppoRethistory, EdmHistoryType.Edmhist_FileState
vHistory = ppoRethistory
For i = LBound(ppoRethistory) To UBound(ppoRethistory)
Debug.Print vHistory(i).moData.mbsStrData2
Next