Select to view content in your preferred language

Create Connection Folder in ArcCatalog through ArcMap VB.NET

890
2
07-27-2011 05:54 AM
KevinThomas1
Emerging Contributor
I am trying to create a connection folder in ArcCatalog through an extension on start up using the following code.

Dim gCatalog As IGxCatalog = New GxCatalogClass
gCatalog.ConnectFolder(Environ("USERPROFILE") & "\My Documents\ArcGIS\")

The code creates the folder connection in the ArcCatalog Window within ArcMap.  However, the folder connection is not seen by dialogs such as AddData, Output Data, or even the ArcCatalog Application itself.  I need the folder to be recognized in these areas.

I think I need to reference the ArcCatalog application in some way.  But not sure how to reference it via an ArcMap extension .dll.

I have come across this file path to reference the User Specific ArcCatalog settings.  But still not sure how to incorporate this into the code.

C:\Documents and Settings\>>yourUserProfile<<\Application Data\ESRI\ArcCatalog\ArcCatalog.gx

thanks

Kevin
0 Kudos
2 Replies
ChrisMatthews
Deactivated User
Hi Kevin

Did you ever find a solution to your problem, I want to connect folders from ArcMap also.


Thanks

Chris
0 Kudos
AlexanderGray
Honored Contributor
I have this requirement also, I wrote this prototype quickly in VBA, it seems to work.  I am going to do it .net next.  Without the save I was getting the same thing as Kevin.
    
    Dim gxCatalog As IGxCatalog
    Set gxCatalog = New gxCatalog
    gxCatalog.ConnectFolder ("c:\")
    Dim gxFile As IGxFile
    Set gxFile = gxCatalog
    gxFile.Save
0 Kudos