Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date and Time Stamp

Status
Not open for further replies.

AyJayEL

Technical User
Jan 30, 2001
425
GB
I would like to put a date and time stamp into the main details of a task in Outlook. Can anyone remind me of the code to do this. I'll attach it to a macro then.

It's yonks since I did any VBA but I do have a little knowledge of it.

Learn something new every day *:->*
AyJayEl
 
For a date and time stamp, use the Format() command, it would have to look something like this:

Format(Now(), "DD/MM/YYYY hh:mm:ss AMPM")
 
Thanks Muzzery.

I created a new macro called dat() (for some reason it would only let me use 3 characters for a name. I then pasted your code into it like this;

Sub dat()
Format(Now(), "DD/MM/YYYY hh:mm:ss AMPM")
End Sub

I get a syntax error when I try to run it. I am probably being really thick... ;-(

Learn something new every day *:->*
AyJayEl
 
You need to asign it to something, like a text box or a variable, try this.

Dim TodaysDateLookup as string

TodaysDateLookup = Format(Now(), "DD/MM/YYYY hh:mm:ss AMPM")

hope it works

muzz
 
Ok slightly better, at least I'm not getting a syntax error message! Trouble is nothing is happening at all. Perhaps I should explain exactly what I'm doing.

I have created the macro as you described. When I am in a task in the main box where you type notes I am then running the macro in order to put the date/time stamp in. Zilch!

Thank you for your help so far but any other ideas as to what I am doing wrong?

Learn something new every day *:->*
AyJayEl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top