Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Anna 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".
Error:
Code = 0xc00ce556
Source = Line : 1; Char : 1
Error Description = Invalid at the top level of the document.
Sub AddDefinedSearchesTest()
Set rep = GetObject(, "EA.App").repository
searchstring = "C:\Search.xml"
rep.AddDefinedSearches searchstring
End Sub
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
-
The parameter is the XML, not the filename to the XML.
-
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.