PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
programming username of editor into custom form
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
programming username of editor into custom form
![]() |
programming username of editor into custom form |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 > > >. > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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 |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

