As requested I’ve attached a sample Visio file and have given some code fragments below to help illustrate the problem.
Please let me know if you need any more information.
Private Sub TestUEFV(ByVal objDirInfo As DirectoryInfo)
For Each objFileIO As FileInfo In objDirInfo.GetFiles("" & fileExtension) 'loop through all files with the relevant extension
currentFilename = objFileIO.FullName
Dim map As New Aspose.Diagram.Diagram(objFileIO.FullName)
For Each page As Aspose.Diagram.Page In map.Pages
For Each shape As Aspose.Diagram.Shape In page.Shapes
Dim user As New Aspose.Diagram.User
user.Name = USERCELL_NAME
Dim ufev As New Aspose.Diagram.UnitFormulaErrV(USERCELL_UFEV_UNIT, USERCELL_UFEV_F, USERCELL_UFEV_E, USERCELL_UFEV_V)
user.Value.Ufev = ufev
shape.Users.Add(user)
Next
Next
map.Save(objFileIO.FullName, Aspose.Diagram.SaveFileFormat.VSDM)
Next
End Sub
Private Sub VerifyUEFV(ByVal objDirInfo As DirectoryInfo)
For Each objFileIO As FileInfo In objDirInfo.GetFiles("" & fileExtension) 'loop through all files with the relevant extension
currentFilename = objFileIO.FullName
Dim map As New Aspose.Diagram.Diagram(objFileIO.FullName)
For Each page As Aspose.Diagram.Page In map.Pages
For Each shape As Aspose.Diagram.Shape In page.Shapes
Dim user As New Aspose.Diagram.User
Dim ufev As Aspose.Diagram.UnitFormulaErrV
user = shape.Users.GetUser(USERCELL_NAME)
ufev = user.Value.Ufev
If ufev.Unit <> USERCELL_UFEV_UNIT Then
WriteToLog(“Test Fail (UEFV unit mismatch). Shape name=” & shape.Name & " Map name=" & objFileIO.FullName)
End If
If ufev.F <> USERCELL_UFEV_F Then
WriteToLog(“Test Fail (UEFV F mismatch). Shape name=” & shape.Name & " Map name=" & objFileIO.FullName)
End If
If ufev.Err <> USERCELL_UFEV_E Then
WriteToLog(“Test Fail (UEFV E mismatch). Shape name=” & shape.Name & " Map name=" & objFileIO.FullName)
End If
If ufev.V <> USERCELL_UFEV_V Then
WriteToLog(“Test Fail (UEFV V mismatch). Shape name=” & shape.Name & " Map name=" & objFileIO.FullName)
End If
Next
Next
Next
End Sub