Jump to content
Software FX Community

Getting all extensions


User (Legacy)
 Share

Recommended Posts

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...