PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming programming username of editor into custom form

Reply

programming username of editor into custom form

 
Thread Tools Rate Thread
Old 13-02-2004, 09:39 PM   #1
AmyG
Guest
 
Posts: n/a
Default programming username of editor into custom form


Im using Outlook XP with a Microsoft Exchange server.
I've created a custom contact form which is available in
the Public Folders to all users on the network.
The form has a "Date Modified" field which is
programatically modified to the current date every time a
contact is edited and saved. Is it possible to add a
field that automatically enters the username of the person
who edited it?

Thanks,
Amy
  Reply With Quote
Old 16-02-2004, 03:26 PM   #2
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: programming username of editor into custom form

NameSpace.CurrentUser will give you that but it will fire the security
prompts unless you permit that property in the Exchange security form
or use Redemption or Extended MAPI. If you are using Redemption you
can use its SafeCurrentUser object.

An alternative is to get the mailbox name using
NameSpace.GetDefaultFolder(olFolderInbox).Parent.Name. That would give
you a string in the form of "Mailbox - user name". You can then use
the StrRev function to find the "-" character and strip out it and
everything to its left from the string. Then strip off any starting
and ending spaces and you have the current user name.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"AmyG" <anonymous@discussions.microsoft.com> wrote in message
news:f90601c3f279$d0637750$a301280a@phx.gbl...
> Im using Outlook XP with a Microsoft Exchange server.
> I've created a custom contact form which is available in
> the Public Folders to all users on the network.
> The form has a "Date Modified" field which is
> programatically modified to the current date every time a
> contact is edited and saved. Is it possible to add a
> field that automatically enters the username of the person
> who edited it?
>
> Thanks,
> Amy



  Reply With Quote
Old 18-02-2004, 02:56 PM   #3
amyg
Guest
 
Posts: n/a
Default Re: programming username of editor into custom form

Thanks. The latter option sounds like it would be best.
I'm fairly novice at this programming though, any chance
you can help me out with the code?
Thanks,
Amy

>-----Original Message-----
>NameSpace.CurrentUser will give you that but it will fire

the security
>prompts unless you permit that property in the Exchange

security form
>or use Redemption or Extended MAPI. If you are using

Redemption you
>can use its SafeCurrentUser object.
>
>An alternative is to get the mailbox name using
>NameSpace.GetDefaultFolder(olFolderInbox).Parent.Name.

That would give
>you a string in the form of "Mailbox - user name". You

can then use
>the StrRev function to find the "-" character and strip

out it and
>everything to its left from the string. Then strip off

any starting
>and ending spaces and you have the current user name.
>
>--
>Ken Slovak
>[MVP - Outlook]
>http://www.slovaktech.com
>Author: Absolute Beginners Guide to Microsoft Office

Outlook 2003
>Reminder Manager, Extended Reminders, Attachment Options
>http://www.slovaktech.com/products.htm
>
>
>"AmyG" <anonymous@discussions.microsoft.com> wrote in

message
>news:f90601c3f279$d0637750$a301280a@phx.gbl...
>> Im using Outlook XP with a Microsoft Exchange server.
>> I've created a custom contact form which is available in
>> the Public Folders to all users on the network.
>> The form has a "Date Modified" field which is
>> programatically modified to the current date every time

a
>> contact is edited and saved. Is it possible to add a
>> field that automatically enters the username of the

person
>> who edited it?
>>
>> Thanks,
>> Amy

>
>
>.
>

  Reply With Quote
Old 18-02-2004, 03:35 PM   #4
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: programming username of editor into custom form

The code would look something like this:

Dim strMailbox
Dim strUser

strMailbox = Application.Session.GetDefaultFolder(6).Parent.Name
'Inbox=6
gstrUser = Trim(Right(strMailbox, Len(strMailbox) -
InStrRev(strMailbox, "-")))

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"amyg" <anonymous@discussions.microsoft.com> wrote in message
news:11da001c3f62f$60575da0$a301280a@phx.gbl...
> Thanks. The latter option sounds like it would be best.
> I'm fairly novice at this programming though, any chance
> you can help me out with the code?
> Thanks,
> Amy



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off