B
Bert Whittier
I've copied a couple of code examples from help files to create a macro to
display my Contacts folder in different views. (The macro is assigned to a
button on a toolbar.)
The macro works fine (see code below).except.when I close Outlook (2003) and
then open it, I get the following message box:
"Outlook experienced a serious error the last time the add-in 'microsoft vba
for outlook addin' was opened. Would you like to disable this add-in? The
reactivate this add-in, click About Microsoft Office Outlook on the Help
menua, and then click Disabled Items."
Anyone have any ideas why this is happening?
Thanks.
Bert
Public Sub NuVw()
Dim myNamespace As Outlook.NameSpace
Dim myolApp As New Outlook.Application
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myOlExp = myolApp.ActiveExplorer
' make sure the current folder is a contacts folder
If myOlExp.CurrentFolder <> "Contacts" Then
Set myOlExp.CurrentFolder =
myNamespace.GetDefaultFolder(olFolderContacts)
End If
' Change the view
myOlExp.CurrentView = "TestView1"
End Sub
By the way.this fragment causes the same problem.
Public Sub test1a()
Dim myolApp As New Outlook.Application
Set myolApp = CreateObject("Outlook.Application")
End Sub
display my Contacts folder in different views. (The macro is assigned to a
button on a toolbar.)
The macro works fine (see code below).except.when I close Outlook (2003) and
then open it, I get the following message box:
"Outlook experienced a serious error the last time the add-in 'microsoft vba
for outlook addin' was opened. Would you like to disable this add-in? The
reactivate this add-in, click About Microsoft Office Outlook on the Help
menua, and then click Disabled Items."
Anyone have any ideas why this is happening?
Thanks.
Bert
Public Sub NuVw()
Dim myNamespace As Outlook.NameSpace
Dim myolApp As New Outlook.Application
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myOlExp = myolApp.ActiveExplorer
' make sure the current folder is a contacts folder
If myOlExp.CurrentFolder <> "Contacts" Then
Set myOlExp.CurrentFolder =
myNamespace.GetDefaultFolder(olFolderContacts)
End If
' Change the view
myOlExp.CurrentView = "TestView1"
End Sub
By the way.this fragment causes the same problem.
Public Sub test1a()
Dim myolApp As New Outlook.Application
Set myolApp = CreateObject("Outlook.Application")
End Sub