06-04-2017
10:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-04-2017
10:38 PM
Surely it will be possible, but first I'd like to clarify some things:
1a) Do you want to change iProperty value based on document's name?
1b) Do you want to change iProperty value globally (same value for all documents)?
2) Do you want to change the iPro values for parts or only sub-assemblies?
3) Do you want to pre-populate the values or let the user write in custom values?
E.g.:
3a) "Select the value for iProA: Value1 "
Value2 "
3b) "Write in the value for iProA: _____"
4) Do you want to create the iPro if it doesn't exist?
5) Do you want to write the iPro in the top-assy as well?
The example below is using:
1) B - globally
2) Both
3) Write in
4) Yes
5) No
Sub Main()
Dim Val1 As String = InputBox("Write in the value for iProA:", "iProA")
Dim oDoc As Document = ThisApplication.ActiveDocument
For Each iDoc In oDoc.AllReferencedDocuments
Dim sFN As String = iDoc.FullFileName
Dim FNP As Integer = InStrRev(sFN, "\", - 1)
Dim docFN As String = Mid(sFN, FNP + 1, Len(sFN) - FNP)
iProperties.Value(docFN, "Custom", "iProA") = Val1
Next
End Sub
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods