Need help to refine StampDate sub

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have searched the Web, Discussion Groups, Outlookcode.com and have found
most of my answer; however, I need help refining.

Outlook 2007 all service packs are up to date, Custom Contact Form

I found Sue Mosher's code for Sub StampDate() *see below, which Stamps the
date and user into the Notes field. Perfect! except I need stamp to appear in
the "Last Author" field from Field Chooser (I can't find the proper name for
it, may be ModifiedBy?)

Sue's Function

Item_Write
Item.BillingInformation = Application.Session.CurrentUser

might be the answer but I don't know where to write it. I tried the
Properties/Validation tab of the "Last Author" field and tried to write the
formula in the box but Item_Write is not an option.

I don't know which code to use or how to combine them to make them work.

Any ideas for this?

*Sub StampDate()
Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objItem As Object
Dim strStamp As String
On Error Resume Next
Set objOL = Application
Set objItem = objOL.ActiveInspector.CurrentItem
If Not objItem Is Nothing Then
Set objNS = objOL.Session
strStamp = Now & " - " & objNS.CurrentUser.Name
objItem.Body = objItem.Body & vbCrLf & strStamp
End If
Set objOL = Nothing
Set objNS = Nothing
Set objItem = Nothing
End Sub
 
Given that the ContactItem object has no built-in Last Author or ModifiedBy field, I'm not sure what you're referring to. If you add such a field to the custom form, you can access it through the UserProperties collection:

objItem.UserProperties("Last Author Stamp") = strStamp
 
It worked beautifully. THANK YOU SO MUCH!!

Final Code:
Sub StampDate()
Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objItem As Object
Dim strStamp As String
On Error Resume Next
Set objOL = Application
Set objItem = objOL.ActiveInspector.CurrentItem
If Not objItem Is Nothing Then
Set objNS = objOL.Session
strStamp = Now & " - " & objNS.CurrentUser.Name
objItem.UserProperties("Last Author Stamp") = strStamp
End If
Set objOL = Nothing
Set objNS = Nothing
Set objItem = Nothing
End Sub
--
Thank you,

scrowley(AT)littleonline.com


Sue Mosher said:
Given that the ContactItem object has no built-in Last Author or ModifiedBy field, I'm not sure what you're referring to. If you add such a field to the custom form, you can access it through the UserProperties collection:

objItem.UserProperties("Last Author Stamp") = strStamp
 
Back
Top