Vba Project OTM - Thisoutlooksession(code) error

  • Thread starter Thread starter XP User
  • Start date Start date
X

XP User

Vba Project OTM - Thisoutlooksession(code) window pops up, and
I have to stop the degugger to send an email.

I've been using OL 2002 for 2 year, never had this problem,

How can I fix it ?
 
Does it stop at a particular line of code? If so, what?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Does it stop at a particular line of code? If so, what?

The Debugger shows:

Compile Error:
Syntax Error

[Application] [ItemSend]

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Dim objNS As NameSpace

Dim objFolder As MAPIFolder

Set objNS = Application.GetNamespace("MAPI")

Set objFolder = objNS.PickFolder

If TypeName(objFolder) <> "Nothing" _ And

IsInDefaultStore(objFolder) Then

Set Item.SaveSentMessageFolder = objFolder

End If
 
If TypeName(objFolder) <> "Nothing" _ And

IsInDefaultStore(objFolder) Then

Does it work of you change the above to

If TypeName(objFolder) <> "Nothing" And IsInDefaultStore(objFolder) Then
 
The underscore continuation character is allowed only at the end of a line and there can be no blank line between the first statement and its continuation. Hence, this is invalid syntax:

If TypeName(objFolder) <> "Nothing" _ And

IsInDefaultStore(objFolder) Then

but this would be fine:

If TypeName(objFolder) <> "Nothing" _
And IsInDefaultStore(objFolder) Then
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


XP User said:
Does it stop at a particular line of code? If so, what?

The Debugger shows:

Compile Error:
Syntax Error

[Application] [ItemSend]

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Dim objNS As NameSpace

Dim objFolder As MAPIFolder

Set objNS = Application.GetNamespace("MAPI")

Set objFolder = objNS.PickFolder

If TypeName(objFolder) <> "Nothing" _ And

IsInDefaultStore(objFolder) Then

Set Item.SaveSentMessageFolder = objFolder

End If





--=20
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for=20
Administrators, Power Users, and Developers

=20
 
Back
Top