
Modification to Time and Date stamp needed
Try:
objItem.Body = objItem.Body & vbCrLf & vbCrLf & _
Date() & " " & FormatDateTime(Now(), vbShortTime)
You can't control the cursor position.
--
Sue Mosher, Outlook MVP
Outlook and Exchange Solutions
at http://www.slipstick.com
Quote:
> I only know enough about VBA to be dangerous :-)
> The following code stamps ok but in the message body I want to stamp then
> write text then stamp over time.
> Problem is the second and subsequent stamps go to the top of the message
> body.
> I would also like the cursor to be at the end of the time stamp or on the
> next line not at the beginning of the stamp as it currently does..
> Third what do I need to do to remove seconds?
> Sub StampDateOnCurrentItem()
> Dim objApp As Application
> Dim objItem As Object ' note late binding
> Set objApp = CreateObject("Outlook.Application")
> Set objItem = objApp.ActiveInspector.CurrentItem
> objItem.Body = Now() & vbCrLf & vbCrLf & objItem.Body
> objItem.Save
> Set objApp = Nothing
> Set objItem = Nothing
> End Sub
> Thanks
> Ian