User (Legacy) Posted April 16, 2002 Report Share Posted April 16, 2002 Hi I am adding a picture annotation and a text box annotation to a chart using the AddExtension method twice. I want to be able to remove one of the extensions but leave the other when the chart gets adjusted. However when I use the GetExtension I only retrieve the last extension added. How do I retrieve the first extension so I can remove it but leave the other? I have included a code snippet below to illustrate how I retrieve it: 'Set ExistingAnnotX = obj.GetExtension("AnnotationX.AnnList") If fn_blnChartHasExtension(obj, ExistingAnnotX) = True Then ' v.Remove (-1) If ExistingAnnotX.Count > 0 Then ' doesn;t seem to pick up logo annotation as one? For intAnnotationCtr = 1 To ExistingAnnotX.Count If ExistingAnnotX.Item(intAnnotationCtr).ObjectType = 6 Then Select Case LCase$(ExistingAnnotX.Item(intAnnotationCtr).Text) Case "target", "drift" ' do nothing Case Else ExistingAnnotX.Remove (intAnnotationCtr) End Select Else ExistingAnnotX.Remove (intAnnotationCtr) End If Next intAnnotationCtr Else obj.ClearData CD_EXTENSIONS End If Else obj.ClearData CD_EXTENSIONS End If --------- Public Function fn_blnChartHasExtension(ByRef cfxChart1 As ChartFX, _ ByRef ExistingAnnotX As AnnotationX) As Boolean On Error GoTo ErrorHandler ' check if a chart has an existing set of annotations and if so return them, 2002-03-13 Set ExistingAnnotX = cfxChart1.GetExtension("AnnotationX.AnnList") fn_blnChartHasExtension = True Proc_Exit: On Error GoTo 0 Exit Function ErrorHandler: fn_blnChartHasExtension = False GoTo Proc_Exit End Function -- ____________________________________ Paul Nailand Visual Risk Pty Ltd u: www.visualrisk.com t: +61 (2) 9388 1370 m:+61 (0) 413 002 802 e: paul@visualrisk.com This email and any attachments is intended only for the person to whom it is addressed. It may contain confidential information. If you receive this document in error, please immediately delete it from your system and notify the sender. You must not disclose, copy, use or rely on any part of this document if you are not the intended recipient. Link to comment Share on other sites More sharing options...
Software FX Posted April 16, 2002 Report Share Posted April 16, 2002 You can not add the same extension twice. Extensions are located by its progid, if you have two with the same you will always get the first one back. -- FP Software FX, Inc. Attachments.zip Link to comment Share on other sites More sharing options...
User (Legacy) Posted April 17, 2002 Author Report Share Posted April 17, 2002 thanks i'm not quite sure i understand how then can i add the two annotation objects to be able to overcome this? thanks paul SoftwareFX Support <support@softwarefx.com> wrote in message news:qA#LJ9V5BHA.312@webserver1.softwarefx.com... > You can not add the same extension twice. Extensions are located by its > progid, if you have two with the same you will always get the first one > back. > > -- > FP > Software FX, Inc. > > Link to comment Share on other sites More sharing options...
Software FX Posted April 17, 2002 Report Share Posted April 17, 2002 An annotation list can contain as many annotation objects as you want. Still the Chart has only ONE annotation list. Check out the samples in our support site, most of them add multiple objects to the annotation list. -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.