why does this ilogic code not work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am running an ilogic code after save. I want to set som properties if this is the first time it have been save
my problem is that it does not change the properties .. but it seems that the code is running as it should
Nulstill SaveAs og Save and replace file
Sub Main()
Dim oDoc As Document =ThisApplication.ActiveDocument 'ThisDoc.Document 'ThisApplication.ActiveDocument
oDoc.DisplayName = ""
If oDoc.FileSaveCounter > 1 Then
debug("Have been Save more Then one time")
'Return
ElseIf oDoc.FileSaveCounter = 1 Then
debug("Save For the first Time " & ThisDoc.FileName(True))
ExcelPath = "C:\Working Folder\CAD\Kallesoe\Kallesoe iLogic\PDFLOg.xlsx"
ExcelSheet = "LastSaveFile"
GoExcel.Open(ExcelPath, ExcelSheet)
Dim LastFileNavn = GoExcel.CellValue(ExcelPath, ExcelSheet, "C3")
Dim Emtry =GoExcel.CellValue(ExcelPath, ExcelSheet, "C4")
GoExcel.Save
GoExcel.Close
'Test code reset SaveAs
debug(LastFileNavn &" was Save Last")
If LastFileNavn <> Emtry Then
debug("1")
'oDoc.DisplayName = ""
debug("1.1")
oTime = Now.ToShortDateString
debug("1.2")
iProperties.Value("Project", "Creation Date") = oTime
debug("1.3")
Try
debug("1.4")
iProperties.Value("Custom", "Surface") = ""
debug("1.5")
Catch
debug("1.6")
End Try
oNAME = ThisApplication.GeneralOptions.UserName
debug("1.7")
iProperties.Value("Project", "Designer") = oNAME
debug("1.8")
iProperties.Value("Project", "Revision Number") = 0
'oDoc
'iProperties.Value(docFName, "Project", "Revision Number") = 0
debug("1.9")
'Test code end
iLogicVb.UpdateWhenDone = True
Else
debug("2")
End If
Try
ThisApplication.CommandManager.StartCommand(CommandIDEnum.kFileSaveCommand)
Catch
End Try
'Run the remainder of your code
GoExcel.Open(ExcelPath, ExcelSheet)
GoExcel.CellValue(ExcelPath, ExcelSheet, "C3") =""
GoExcel.Save
GoExcel.Close
End If
End Sub
Public Sub debug(txt As String)
Trace.WriteLine("NTI : " & txt)
End Sub
Revision Number are not been set to 0 and Designer are not been set to oNAME even if after the debug code are running 1.7 ,1.8 and 1.9 are running.
how can this be ?
