I did a lillte change to your code . And add it to after save. This way make if look after I save it if it only have been save one time . And make it change the designer navn , reset Revision Number and an custom properties that we use .... a lillte like you can do with copy design in vault .. but somthing it just easy to use command like Save and Replace.
Save before did not work sind it still look at the old file at this point in the saving processe..and I change ThisApplication.ActiveDocument to ThisDoc.Document sind my code not always are running on the Active document but an subcompoment of the AtiveDocument .. but your code give my the inspiration I did to find my way
Dim oDoc As Document = ThisDoc.Document 'ThisApplication.ActiveDocument
If oDoc.FileSaveCounter > 1 Then
'Return
ElseIf oDoc.FileSaveCounter = 1 Then
'Test code reset SaveAs
booleanParam = InputRadioBox("Is this an new files " + iProperties.Value("Project", "Part Number"), "Ja", "Nej", booleanParam, Title := "Title")
If booleanParam = True Then
oDoc.DisplayName=""
oTime = Now.ToShortDateString
iProperties.Value("Project", "Creation Date") = oTime
MessageBox.Show(iProperties.Value("Project", "Part Number") & "Reset Surface ", "Title")
iProperties.Value("Custom", "Surface") = ""
oNAME = ThisApplication.GeneralOptions.UserName
iProperties.Value("Project", "Designer") = oNAME
iProperties.Value(docFName, "Project", "Revision Number") = 0
'Test code end
iLogicVb.UpdateWhenDone = True
ThisApplication.CommandManager.StartCommand(CommandIDEnum.kFileSaveCommand)
'Run the remainder of your code
End If
End If
..