how chance ComponentOccurrence.name

how chance ComponentOccurrence.name

Anonymous
Not applicable
447 Views
2 Replies
Message 1 of 3

how chance ComponentOccurrence.name

Anonymous
Not applicable
hi

i write macro "occurance.name" but it is not run

how change ComponentOccurrence name









Dim occuname As ComponentOccurrence

For Each occuname In odoc.ComponentDefinition.Occurrences

If occuname.Name = secilidosya Then

occuname.name="yeniisim" {color:#ff0000}this code give error

{color}End If

next Edited by: altargokhan on Mar 21, 2010 9:52 PM
0 Likes
448 Views
2 Replies
Replies (2)
Message 2 of 3

Ralf_Krieg
Advisor
Advisor
Hello

Same problem here. Try to set the name first to a number like "123" and set your real name in a second step. Don't know why, but this works in my tests.

R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 3

Anonymous
Not applicable
The only thing I can think of is that you're trying to name two things the same. I ran the following code on a random assembly and it worked just fine:

{code}
Sub x()
Dim a As Application
Set a = ThisApplication
Dim d As AssemblyDocument
Set d = a.ActiveDocument
Dim i As Integer
i = 0
For i = 1 To d.ComponentDefinition.Occurrences.Count
d.ComponentDefinition.Occurrences(i).Name = Str(i)
Next
Stop

End Sub
{code}
0 Likes