- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
First off let me say that I'm a beginner when it comes to writing code, so I have a very basic idea of what I'm doing. So when you point out my mistake, please explain why I did in very basic terms.
The code I'm writing is to compare the File Name and the Part Number. If they match then it does nothing. If they don't then a message will appear asking if the user want to fix the difference or leave it be. If they want to leave it be then it creates a custom ipropertry that it will look for next time this code is ran.
I can get it all to run expect for the most important part and that is changing the part number so matches the file name.
Can someone point out my mistake and tell me in simple terms how to fix it?
oDoc = ThisDoc.FileName(False)
PartNumber = iProperties.Value("Project", "Part Number")
If PartNumber = oDoc
Return
Else
Try
oProp = iProperties.Value("Custom", "NotFileName")
Return
Catch
i = MessageBox.Show("Tree Name", "My iLogic Dialog", MessageBoxButtons.YesNo, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
If i=MsgBoxResult.Yes Then
oDoc = PartNumber
ElseIf i=MsgBoxResult.No Then
iProperties.Value("Custom", "NotFileName") = "No"
EndIf
End Try
End If
Solved! Go to Solution.