> That version is for VBA. The version in listing 20.7 is for VBScript. You'll
> probably learn a lot by comparing them.
[quoted text clipped - 12 lines]
> > It gives the same error with Outlook 2002 & 2003. My Inbox is on the
> > Exchange Serverby default. Any ideas?
I don't know why the Application.GetNamespace statement would fail, but you
can't use olFolderInbox in VBScript unless you have a Const declaration for
it somewhere. Also use Mid instead of Right to get the name:
GetMailboxUserName = Mid(strName, intPos + 9)
Also, I can't see that you're using a proper event handler to call this
code. Put a command button on your form and put your Call MailUser in it:
Sub CommandButton1_Click()
Call MailUser
End Sub
Click the button to test.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Here's what I put in the Script Editor & published it:
>
[quoted text clipped - 26 lines]
>> You'll
>> probably learn a lot by comparing them.
>> >I used the Function GetMailboxUserName() on page 233, Listing 12.8 from
>> >the
[quoted text clipped - 10 lines]
>> > It gives the same error with Outlook 2002 & 2003. My Inbox is on the
>> > Exchange Serverby default. Any ideas?
Curtis Fowler - 30 Sep 2004 21:31 GMT
I tried using the index (6) instead of (olFolderInbox) but still got the error.
I'll try adding a button to see what it does. Thanks.
> I don't know why the Application.GetNamespace statement would fail, but you
> can't use olFolderInbox in VBScript unless you have a Const declaration for
[quoted text clipped - 56 lines]
> >> > It gives the same error with Outlook 2002 & 2003. My Inbox is on the
> >> > Exchange Serverby default. Any ideas?
Curtis Fowler - 01 Oct 2004 15:41 GMT
It likes it working from a Cmd button. No errors at all. Thanks for all your
help Sue!
> I tried using the index (6) instead of (olFolderInbox) but still got the error.
> I'll try adding a button to see what it does. Thanks.
[quoted text clipped - 59 lines]
> > >> > It gives the same error with Outlook 2002 & 2003. My Inbox is on the
> > >> > Exchange Serverby default. Any ideas?