Author Topic: AddDefinedSearches  (Read 2975 times)

Anna

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
AddDefinedSearches
« on: October 03, 2008, 02:15:20 am »
Hi,

how do i use the Method AddDefinedSearches in the correct way?
I tried it with a filename as used for ImportPackageXMI, but i allways got an error message.

The format of the filename should be ok, i use the same format for ImportPackageXMI and it works fine. The File itself should be ok too, i exported it with "Manage Seaches".

Quote
Error:
Code = 0xc00ce556
Source = Line : 1; Char : 1
Error Description = Invalid at the top level of the document.

Code: [Select]
Sub AddDefinedSearchesTest()
    Set rep = GetObject(, "EA.App").repository
    searchstring = "C:\Search.xml"
    rep.AddDefinedSearches searchstring
End Sub

Quote
AddDefinedSearches (string sXML)
  
 Enables you to enter a set of defined searches that last in Enterprise Architect for the life of the application. When Enterprise Architect loads again they must be inserted again by your Add-In.

Parameters:

sXML: String - the XML of the defined searches; you can get this XML by performing an export of the searches from the Manage Searches dialog in Enterprise Architect.  

Any Ideas, whats wrong with it?

Thanks!
Anna

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: AddDefinedSearches
« Reply #1 on: October 03, 2008, 08:15:30 am »
The parameter is the XML, not the filename to the XML.

Anna

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: AddDefinedSearches
« Reply #2 on: October 08, 2008, 03:43:43 am »
Thanks, you helped me a lot.
I had trouble getting that lot information into one string, but since i knew it have to be possible i got it.