Strange Outlook Add-In problems
I think I have solved one thing causing the error.
In many functions I'm getting different folders.
For Example:
....
'DB.OlApp is a global Object, I'm setting at On_Connection.
....
Dim oNameSpace As outlook.NameSpace
Dim oPersFolder As outlook.MAPIFolder
Set oNameSpace = DB.OlApp.GetNamespace("MAPI")
Set oPersFolder = oNameSpace.GetDefaultFolder(olFolderContacts).Pare nt
....
Set oPersFolder = Nothing
Set oNameSpace = Nothing
Now I'm getting my folders without an own namespace variable
Dim oPersFolder As outlook.MAPIFolder
Set oPersFolder =
DB.OlApp.GetNamespace("MAPI").GetDefaultFolder(olF olderContacts).Parent
....
Set oPersFolder = Nothing
So I think the Script Stopper problem has also something to do with the
namespace object, not only with the application object.
Would it be a problem to do the same with the namespace object as I'm
doing it with the application object?
At On_Connection I'm setting a global namespace variable.
Then I'm always using the same global namespace object.
Like...
DB.olNameSpace would then be the global namespace object.
And I'm always using that object.
Dim oPersFolder As outlook.MAPIFolder
Set oPersFolder =
DB.olNameSpace.GetDefaultFolder(olFolderContacts). Parent
Is this the best solution or should I leave it like that?
Set oPersFolder =
DB.OlApp.GetNamespace("MAPI").GetDefaultFolder(olF olderContacts).Parent
|