Vba Project OTM - Thisoutlooksession(code) error

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 ?
 
S

Sue Mosher [MVP-Outlook]

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
 
X

XP User

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
 
M

Mark Rae

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
 
S

Sue Mosher [MVP-Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top