Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello,
I'm trying to migrate the following vba macro to vb.net. I can't find the parts in (properties of) the pattern,
Any idea?
Thanks for any help
Yours
Public Sub InIam_ChromePolished() Dim oDoc As AssemblyDocument Set oDoc = ThisApplication.ActiveDocument ' Get a reference to the RenderStyle named "Chrome - Polished". Dim oRenderStyle As RenderStyle Set oRenderStyle = oDoc.RenderStyles.Item("Chrome - Polished") 'a selected item Dim oSel As SelectSet Set oSel = oDoc.SelectSet Dim oCol As New Collection Dim oPart As Document If oSel.Count > 0 Then For Each oOcc In oSel If oOcc.Type = kDocumentObject Then oCol.Add (oOcc.Definition.Document) ElseIf oOcc.Type = kCircularOccurrencePatternObject Then Dim oOccPel As OccurrencePattern Set oOccPel = oOcc Dim oOccEls As OccurrencePatternElement Set oOccEls = oOccPel.OccurrencePatternElements.Item(1) Dim oPatObject As Object For Each oPatObject In oOccEls.Occurrences oCol.Add (oPatObject.Definition.Document) 'Debug.Print oPatObject.Name Next End If Next End If ' Assign the render style to the part. For Each oPart In oCol oPart.ActiveRenderStyle = oRenderStyle Next ' Force the view to update to see the change. ThisApplication.ActiveView.update End Sub
Solved! Go to Solution.