GeniusConnect support forum
GeniusConnect support forum
Home | Profile | Register | Active Topics | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GeniusConnect
 Developers
 How to access GeniusConnect from VBA
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic  Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Admin

Czech Republic
1708 Posts

Posted - 03 Feb 2012 :  11:44:28  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Admin

Czech Republic
1708 Posts

Posted - 08 Feb 2012 :  01:02:57  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Admin

Czech Republic
1708 Posts

Posted - 19 Jul 2012 :  12:55:25  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
End Sub
Go to Top of Page
   Topic  Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GeniusConnect support forum © Copyright (C) 2003 - 2020, GeniusConnect, All Rights Reserved. Go To Top Of Page
Snitz Forums 2000