Message 1 of 6

Not applicable
02-13-2013
06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I name my files with our part numbers and the revision number. Our part numbers are 6 to 9 digits long and sometimes start with a zero! My iLogic rule, while simple, drops the first zero if its there. See the "FirstNumbers" below: (I tried to add the CStr(), but now I see that it just changes it to text after it drops the zero!)
Any suggestions?
ThisFile = ThisDoc.FileName(False) 'without extension FirstNumbers = CStr(Val(ThisFile)) 'sets the first numbers from the file name to text PartNumber = iProperties.Value("Project", "Part Number") 'reads part number from file
'check to see if the part number is the same as the file name's numbers If String.Compare(FirstNumbers, PartNumber, True) = 0 Then 'do nothing Else
'set the Part Number to the file name's numbers iProperties.Value("Project", "Part Number") = FirstNumbers
'let's me know that something has been done MessageBox.Show("Part Number has been set to " & FirstNumbers, "Part Number from File Name") End If
Solved! Go to Solution.