Message 1 of 9

Not applicable
01-03-2018
04:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey,
I have been using this code below, i did not create it, but i am wishing to add If and Then statement to it, but i have no idea where to start, is someone able to re-write this to include those statements
SyntaxEditor Code Snippet
Sub Main() 'Purpose: Push file name to sheet name'21-Sept-16 Dim oDoc As Document = ThisApplication.ActiveDocument Dim oSheet As Sheet Dim oDrawingView As DrawingView 'Iterate through sheets For Each oSheet In oDoc.Sheets 'Grab the first drawing view on the sheet oDrawingView = oSheet.DrawingViews(1) 'Grab the model of the first drawing view oModel = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument 'Grab the custom iproperty of the first drawing view model oModel1 = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName o_iProp = iProperties.Value(oModel1, "Custom", "RevisionUK") 'set sheet name to filename and custom iprop from model oSheet.Name = System.IO.Path.GetFileNameWithoutExtension(oModel.FullFileName)& " - " & o_iProp
End Sub
Solved! Go to Solution.