How to access GeniusConnect from Outlook Visual Basic for Applications (VBA)


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:


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:


Public Sub LoadAllContacts()

Dim addIn As COMAddIn

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


Dim GC As Object

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