Jump to content
Software FX Community

Getting all extensions

User (Legacy)

Recommended Posts


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


Select Case


Case "target", "drift"

' do nothing

Case Else

ExistingAnnotX.Remove (intAnnotationCtr)

End Select


ExistingAnnotX.Remove (intAnnotationCtr)

End If

Next intAnnotationCtr



End If



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


On Error GoTo 0

Exit Function


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


i'm not quite sure i understand

how then can i add the two annotation objects to be able to overcome this?



SoftwareFX Support <support@softwarefx.com> wrote in message


> 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


This topic is now archived and is closed to further replies.

  • Create New...