View Single Post
  #5  
Old July 21st 09, 04:13 PM posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.outlook.program_vba
Alan Moseley
external usenet poster
 
Posts: 61
Default Insert date at cursor location

What about this?

Public Sub InsertDate()
SendKeys Date()
End Sub

It's a bit pants and you might want to do some checking before the sendkeys
runs, but it might work for you.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"F.H. van Zelm" wrote:

Hi,

Once, I had a macro to inert the current date anywhere in the notes field of
an open item.
That macro has ... gone with the wind.

I recreated:
=====================================
Sub DateInsert()
Dim myOlApp As New Outlook.Application
Dim myItem As Object
Set myItem = myOlApp.ActiveInspector.CurrentItem
myItem.Body = Date & vbCr & myItem.Body
Set myItem = Nothing
Set myOlApp = Nothing
End Sub

=====================================
It works but, of course, inserts the date on top of any text.

What to write to make the time stamp appear at the cursor?

Many thanks, Frans
www.fhvzelm.com



Ads