Administrator
  •  Admin
  • Advanced Member Topic Starter
2012-02-03T11:44:00Z
1. Close Outlook
2. Start regedit and change PublishCOMAddin to 1
HKEY_CURRENT_USER\Software\Genius@Work\GeniusConnect\Settings
Key:PublishCOMAddin
Default=0, Set to 1 to make COM interface visible in COMAddin office object for VBA or other Add-ins
3.Start Outlook

Methods:
OnBarClick(int Button)
Button Param:
IDS_BUTTON_SETUP           33002 //Config dialog 
IDS_BUTTON_STORE           33006 //Store selected item(s)
IDS_BUTTON_LOAD            33010//Load selected item(s)
IDS_BUTTON_LOADALL         33014//Load All (current folder)
IDS_BUTTON_STOREALL        33019//Store All (current folder)
IDS_BUTTON_THLP            33020//Start Help
IDS_BUTTON_MAILING         33024//Start Mailing

Example Code:

GeniusConnect ver 5.0.0.8 and lower:

Public Sub StartConfigDialog()
Dim addIn As COMAddIn
Set addIn = Application.COMAddIns.Item("OutlookConnect.OutlookConnection.1")

    If Not (addIn Is Nothing) Then
        addIn.Object.OnBarClick 33002
    End If
End Sub

GeniusConnect 5.0.0.9 and higher:

Public Sub StartConfigDialog()
Dim addIn As COMAddIn
Set addIn = Application.COMAddIns.Item("GeniusConnectSync.Connect")

Dim GC As Object
Set GC = addIn.Object


If Not (GC Is Nothing) Then
GC.OnBarClick 33002
End If
End Sub


SyncFolder(IDispatch* pFolder, int nDirection)
pFolder param:
MAPIFolder object

nDirection param:
0=Load All
1=Load selected
2=Save All
3=Save Selected
4=Load and Stora All
5=Store and Load All

Example Code:

GeniusConnect ver 5.0.0.8 and lower:

Public Sub LoadAllContacts()
Dim addIn As COMAddIn
Set addIn = Application.COMAddIns.Item("OutlookConnect.OutlookConnection.1")
Dim objFolder As Outlook.MAPIFolder
Set objFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts)

    If Not (addIn Is Nothing) Then
        addIn.Object.SyncFolder objFolder, 0
    End If
End Sub


GeniusConnect 5.0.0.9 and higher:

Public Sub LoadAllContacts()
Dim addIn As COMAddIn
Dim GC As Object

Set addIn = Application.COMAddIns.Item("GeniusConnectSync.Connect")
Set GC = addIn.Object


Dim objFolder As Outlook.MAPIFolder
Set objFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts)

    If Not (GC Is Nothing) Then
        GC.SyncFolder objFolder, 0
    End If
End Sub
Sponsor
GeniusConnect documentation search (User Manual Downloads...)
Administrator
  •  Admin
  • Advanced Member Topic Starter
2012-02-08T01:02:00Z
Example implemented by our user, Thanks Daniel:

Public Sub LoadAllFolders()
    DoEvents
   
    Dim objExplorer As Outlook.Explorer
    Dim objNS As Outlook.NameSpace
    Dim objGC As OUTLOOKCONNECTLib.OutlookConnection
    
    Set objNS = Application.GetNamespace("MAPI")
    Set objExplorer = Application.ActiveExplorer
    
    Set objExplorer.CurrentFolder = objNS.Folders("SomeFolderTree").Folders("SomeFolder")
    DoEvents
    DoEvents
    
    Set objGC = Application.COMAddIns.Item("OutlookConnect.OutlookConnection.1").Object
    If Not (objGC Is Nothing) Then
        objGC.OnBarClick (33014)   'Load All
        DoEvents
        objGC.OnBarClick (33019)   'Store All
        DoEvents

        Set objExplorer.CurrentFolder = objNS.Folders("SomeFolderTree").Folders("SomeOtherFolder")
        DoEvents
        objGC.OnBarClick (33014)
        DoEvents
        objGC.OnBarClick (33019)
        DoEvents
        
        Set objExplorer.CurrentFolder = objNS.Folders("SomeFolderTree").Folders("ThirdFolder")
        DoEvents
        objGC.OnBarClick (33014)
        DoEvents
        objGC.OnBarClick (33019)
        DoEvents
        
        Set objExplorer.CurrentFolder = objNS.Folders("SomeFolderTree").Folders("FourthFolder")
        DoEvents
        objGC.OnBarClick (33014)
        DoEvents
        objGC.OnBarClick (33019)
        DoEvents

    End If
        
    Set objExplorer = Nothing
    Set objNS = Nothing
    Set objGC = Nothing
    
End Sub
Administrator
  •  Admin
  • Advanced Member Topic Starter
2012-07-19T12:55:00Z
GeniusConnect 5.0.0.9 changes

Please use this code to get access to GeniusConnect


Dim addIn As COMAddIn
Dim GC As Object

Set addIn = Application.COMAddIns.Item("GeniusConnectSync.Connect")
Set GC = addIn.Object

If Not (GC Is Nothing) Then
GC.CallSomeFunc()
End If