Time/Date stamps in Word

  • Thread starter scottalanclymer
  • Start date
S

scottalanclymer

Have been using Word to edit my webpage. Have 5 timezones I want t
automatically update the stamp every time I open the file. See it a
home comcast net ~scottalanclymer. I think the method I'm currentl
using is considered a table. It's a snippit of a few columns and row
from excel using the formulas I already had there in my dail
worksheet. But every time I open my page in Word to update it, I hav
to right click the table, hit O, hit E, the table updates the formula
from the current system time. Then I hit escape. It creates an IMAGE o
the table. Then I have to adjust the width or heighth of the image t
make it look like it's close to being normal again. It's a pain. I'
rather be able to write the code in Word, 5 lines, utilizing th
time/date function, with offsets for the hours I need, I already hav
the math done on that, and have all 5 lines update with no work on m
part each time I open the file for editing. Any takers on thi
challenge
 
S

scottalanclymer

Let me simplify my question:
Is there a simple code to insert the current system time, but offset b
1 hour, in a Word document?
 
G

Greg Maxey

Selection.InsertAfter "The time: " & Format(Time, "h:mm") & _
vbCr & "The time an hour ago: " & _
Format(DateAdd("h", -1, Time), "h:mm") & vbCr & _
"The time an hour from now: " & Format(DateAdd("h", 1, Time), "h:mm")
 
S

scottalanclymer

'Greg Maxey[_2_ said:
;456399']Selection.InsertAfter "The time: " & Format(Time, "h:mm") & _
vbCr & "The time an hour ago: " & _
Format(DateAdd("h", -1, Time), "h:mm") & vbCr & _
"The time an hour from now: " & Format(DateAdd("h", 1, Time),
"h:mm")

ok, that's a little obscure for me. I know my way around Excel, but
Word is a different animal. Is that some kind of programming language?
Cause it's just jibberish to me. Let me put a section of my excel file
here.

http://home.comcast.net/~scottalanclymer/current.times.xlsx

It's only 40K. It shows what I'm doing in Excel. I just want a simple
way to do the same thing in Word. Don't know how to apply programming
code in Word.
 
G

Graham Mayor

Greg has included vba code which when run will insert the time plus one hour
at the cursor - see http://www.gmayor.com/installing_macro.htm
If you want it calculate the date in the document without using a macro,
then refer to the link I pointed you to earlier. The field construction
required to add times is on the last page of the document. Ensure that you
read the introduction before using it.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


scottalanclymer said:
'Greg Maxey[_2_ said:
;456399']Selection.InsertAfter "The time: " & Format(Time, "h:mm") & _
vbCr & "The time an hour ago: " & _
Format(DateAdd("h", -1, Time), "h:mm") & vbCr & _
"The time an hour from now: " & Format(DateAdd("h", 1, Time),
"h:mm")

ok, that's a little obscure for me. I know my way around Excel, but
Word is a different animal. Is that some kind of programming language?
Cause it's just jibberish to me. Let me put a section of my excel file
here.

http://home.comcast.net/~scottalanclymer/current.times.xlsx

It's only 40K. It shows what I'm doing in Excel. I just want a simple
way to do the same thing in Word. Don't know how to apply programming
code in Word.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top