Time stamp

When I close a document I would like to have the time it was saved at the 
top of the document.  How is that done, please?

JB 


0
JB
1/17/2010 12:16:01 PM
word.newusers 801 articles. 0 followers. Follow

3 Replies
1274 Views

Similar Articles

[PageSpeed] 51

You could use a savedate field eg { SaveDate \@ "HH:mm" } which will record 
the last time the document was saved when the document is next opened, but 
the field will not update automatically as you make saves to the document 
during the course of working - it will however fulfil the basic criterion of 
recording the time.

Or you could intercept the FileSave command to add a document variable to 
the document and update it each time the document is saved and if you have a 
docvariable field in the document - here { DocVariable varSaved } - that 
field will display the time the document was saved and update each time you 
save.

Sub FileSave()
Dim oVars As Variables
Dim sDate As String
Dim oStory As Range
Dim oField As Field
Set oVars = .Variables
With ActiveDocument
    oVars("varSaved").Value = "Last saved at " _
    & Format(Time, "hh:mm")
    For Each oStory In .StoryRanges
        For Each oField In oStory.Fields
            If oField.Type = wdFieldDocVariable Then oField.Update
        Next oField
    Next oStory
    .Save
ActiveWindow.Caption = ActiveDocument.FullName
End With
End Sub
http://www.gmayor.com/installing_macro.htm


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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



"JB" <open@closed.com> wrote in message 
news:%23729W72lKHA.5656@TK2MSFTNGP02.phx.gbl...
> When I close a document I would like to have the time it was saved at the 
> top of the document.  How is that done, please?
>
> JB
> 


0
Graham
1/17/2010 1:47:53 PM
Hello Graham

You may remember that you helped m with a Mavro:  SaveToTwoLocations.  At 
the time, I left it at that.

Could I add something to that particular macro, which is working fine, so 
that it stamps the time of saving?


Sub SaveToTwoLocations()
Dim oDoc As Document
Dim strFileA As String
Dim strFileB As String
Dim strBackupPath As String
'Define the backup location
strBackupPath = "C:\Documents and Settings\Qimi\Desktop\Backups\"
On Error Resume Next
Set oDoc = ActiveDocument
With oDoc
     'Mark the cursor position with a bookmark
     .Bookmarks.Add Range:=Selection.Range, Name:="OpenAt"
     .Save
     strFileA = .FullName
     strFileB = strBackupPath & "Backup " & .Name
     .Close 'Close the document
End With
FileCopy strFileA, strFileB 'Copy the document
Documents.Open strFileA 'Reopen the original document

ActiveWindow.View.Type = wdPrintView
'and restore the cursor position
ActiveDocument.Bookmarks("OpenAt").Select
End Sub




Thank you








"Graham Mayor" <gmayor@REMOVETHISmvps.org> escreveu na mensagem 
news:%23Xnkqu3lKHA.5040@TK2MSFTNGP06.phx.gbl...
> You could use a savedate field eg { SaveDate \@ "HH:mm" } which will 
> record the last time the document was saved when the document is next 
> opened, but the field will not update automatically as you make saves to 
> the document during the course of working - it will however fulfil the 
> basic criterion of recording the time.
>
> Or you could intercept the FileSave command to add a document variable to 
> the document and update it each time the document is saved and if you have 
> a docvariable field in the document - here { DocVariable varSaved } - that 
> field will display the time the document was saved and update each time 
> you save.
>
> Sub FileSave()
> Dim oVars As Variables
> Dim sDate As String
> Dim oStory As Range
> Dim oField As Field
> Set oVars = .Variables
> With ActiveDocument
>    oVars("varSaved").Value = "Last saved at " _
>    & Format(Time, "hh:mm")
>    For Each oStory In .StoryRanges
>        For Each oField In oStory.Fields
>            If oField.Type = wdFieldDocVariable Then oField.Update
>        Next oField
>    Next oStory
>    .Save
> ActiveWindow.Caption = ActiveDocument.FullName
> End With
> End Sub
> http://www.gmayor.com/installing_macro.htm
>
>
> -- 
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor -  Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
>
> "JB" <open@closed.com> wrote in message 
> news:%23729W72lKHA.5656@TK2MSFTNGP02.phx.gbl...
>> When I close a document I would like to have the time it was saved at the 
>> top of the document.  How is that done, please?
>>
>> JB
>>
>
> 


0
JB
1/17/2010 2:32:19 PM
If you mean you want the time written in the document as opposed to in the 
filename then the two macros can easily be combined. Put a docvariable field 
{ DocVariable varSaved } at the location where you wish the time to appear.

Sub SaveToTwoLocations()
Dim oDoc As Document
Dim strFileA As String
Dim strFileB As String
Dim strBackupPath As String
Dim oVars As Variables
Dim sDate As String
Dim oStory As Range
Dim oField As Field

'Define the backup location
strBackupPath = "C:\Documents and Settings\Qimi\Desktop\Backups\"
On Error Resume Next
Set oDoc = ActiveDocument
With oDoc
    Set oVars = .Variables
    'Mark the cursor position with a bookmark
    .Bookmarks.Add Range:=Selection.Range, name:="OpenAt"
    oVars("varSaved").Value = "Last saved at " _
    & Format(Time, "hh:mm")
    For Each oStory In .StoryRanges
        For Each oField In oStory.Fields
            If oField.Type = wdFieldDocVariable Then oField.Update
        Next oField
    Next oStory
    .Save
    strFileA = .FullName
    strFileB = strBackupPath & "Backup " & .name
    .Close 'Close the document
End With
FileCopy strFileA, strFileB 'Copy the document
Documents.Open strFileA 'Reopen the original document

ActiveWindow.View.Type = wdPrintView
'and restore the cursor position
ActiveDocument.Bookmarks("OpenAt").Select
End Sub

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"JB" <open@closed.com> wrote in message 
news:uvCziH4lKHA.2184@TK2MSFTNGP04.phx.gbl...
> Hello Graham
>
> You may remember that you helped m with a Mavro:  SaveToTwoLocations.  At 
> the time, I left it at that.
>
> Could I add something to that particular macro, which is working fine, so 
> that it stamps the time of saving?
>
>
> Sub SaveToTwoLocations()
> Dim oDoc As Document
> Dim strFileA As String
> Dim strFileB As String
> Dim strBackupPath As String
> 'Define the backup location
> strBackupPath = "C:\Documents and Settings\Qimi\Desktop\Backups\"
> On Error Resume Next
> Set oDoc = ActiveDocument
> With oDoc
>     'Mark the cursor position with a bookmark
>     .Bookmarks.Add Range:=Selection.Range, Name:="OpenAt"
>     .Save
>     strFileA = .FullName
>     strFileB = strBackupPath & "Backup " & .Name
>     .Close 'Close the document
> End With
> FileCopy strFileA, strFileB 'Copy the document
> Documents.Open strFileA 'Reopen the original document
>
> ActiveWindow.View.Type = wdPrintView
> 'and restore the cursor position
> ActiveDocument.Bookmarks("OpenAt").Select
> End Sub
>
>
>
>
> Thank you
>
>
>
>
>
>
>
>
> "Graham Mayor" <gmayor@REMOVETHISmvps.org> escreveu na mensagem 
> news:%23Xnkqu3lKHA.5040@TK2MSFTNGP06.phx.gbl...
>> You could use a savedate field eg { SaveDate \@ "HH:mm" } which will 
>> record the last time the document was saved when the document is next 
>> opened, but the field will not update automatically as you make saves to 
>> the document during the course of working - it will however fulfil the 
>> basic criterion of recording the time.
>>
>> Or you could intercept the FileSave command to add a document variable to 
>> the document and update it each time the document is saved and if you 
>> have a docvariable field in the document - here { DocVariable 
>> varSaved } - that field will display the time the document was saved and 
>> update each time you save.
>>
>> Sub FileSave()
>> Dim oVars As Variables
>> Dim sDate As String
>> Dim oStory As Range
>> Dim oField As Field
>> Set oVars = .Variables
>> With ActiveDocument
>>    oVars("varSaved").Value = "Last saved at " _
>>    & Format(Time, "hh:mm")
>>    For Each oStory In .StoryRanges
>>        For Each oField In oStory.Fields
>>            If oField.Type = wdFieldDocVariable Then oField.Update
>>        Next oField
>>    Next oStory
>>    .Save
>> ActiveWindow.Caption = ActiveDocument.FullName
>> End With
>> End Sub
>> http://www.gmayor.com/installing_macro.htm
>>
>>
>> -- 
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor -  Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>>
>> "JB" <open@closed.com> wrote in message 
>> news:%23729W72lKHA.5656@TK2MSFTNGP02.phx.gbl...
>>> When I close a document I would like to have the time it was saved at 
>>> the top of the document.  How is that done, please?
>>>
>>> JB
>>>
>>
>>
>
> 


0
Graham
1/18/2010 6:28:33 AM
Reply:

Similar Artilces:

resource time
Hi, Is there documented information (MS or other) for how much resource time is required to support common exchange server and client tasks? Basically the day to day tasks. The only documented information i have come across is that it takes about .25 Administrators for every 100 users. thanks. wow, where did you find that statistic? I'd like to show it to my boss...I single-handedly support over 8,000 users here, and also assist with support for two remote sites...that being said, Exchange support (excluding support for Outlook issues, which is a lot of what I have to do) boils down...

saving the same file in different places at a time
hi, i have an excel file in one system when i update this file, is it possible some range of cells in this file to be saved in the different system also how do i give a link to the other file? appreciate, if anyone could help Sounds like you want to paste a link so that the cell will update every time the other cell gets new info... To do this, say you want to link cell A1 to cell A7...click on cell A7 and click copy...Go to cell A1 and click paste...Then (if you have Excel 2003), click on Edit/Paste Special/Paste Link and you now have youe link...The "Paste Link" Button ...

Time chart
I need a time chart as in example A1= Henry B1=15 C1=21 A2= Sally B2=12 C2-=18 A3= George B3=11 C3=16 A4= Alex B4=10 C4=14 Henry ------------------------ Sally ----------------------- George -------------------- Alex ----------------- 10 11 12 13 14 15 16 17 18 19 20 21 You could simulate the chart with an XY Scatter chart of the data 15 4 21 4 12 3 18 3 11 2 16 2 10 1 14 1 Format the y-axes to show no labe...

Time input mask format
If I input - "340 a", I want it to show "3:40 AM" or if I input 1230 p, I want it formated as 12:30 PM can this be done? enter your times as 3:40 or 12:30 and set the format of the cell to show it as am or pm format ,,,, cells,,,,custom,,, h:mm AM/PM "WNB-96740" wrote: > If I input - "340 a", I want it to show "3:40 AM" > > or if I input 1230 p, I want it formated as 12:30 PM > > can this be done? There is no way to set up an input mask as you describe without using VBA. See Chip Pearson's site for quicken...

Multiple time ranges
I am trying to create a formula that will look up the time values and return a letter. Times are in column F. Must include seconds (as values does include seconds). 07:00:00 - 17:30:00 = "A" 17:31:00 - 00:30:00 = "B" 00:31:00 - 06:59:00 = "C" <as values does include seconds).> But you miss out whole minutes in your specications. Anyway, this should work, but do check your threshold values. Maybe you need to add a second or less than a second. Set up a table like this (in this example: A1:B4) 0:00:00 B 0:30:00 C 7:00:00 A 17:30:00 B With your time to l...

How do I set up a template to save time typing names
I have to send a lot of e-mails to the same people, and always more than one person. How do I set up a template so that I don't have to keep typing who it is to and who I am 'Cc' to? traceyella <traceyella@discussions.microsoft.com> wrote: > I have to send a lot of e-mails to the same people, and always more > than one person. How do I set up a template so that I don't have to > keep typing who it is to and who I am 'Cc' to? Create your message, but instead of sending it, save it as an OFT. WHen you want to send it, forward it from your Drafts fold...

Length of time to publish
Does anyone know why it takes a very long time to publish my websites ? Is it something I'm doing wrong or is my computer slow ? Many variables. The speed of your internet connection. Traffic on the internet. And, the host may have it throttled to a certain amount. -- Tom [Pepper] Willett Microsoft MVP - FrontPage Since 1997 --------------------------- "mousey" <mousey@discussions.microsoft.com> wrote in message news:90A5062A-42EB-4039-8E24-20D26F260CB7@microsoft.com... : Does anyone know why it takes a very long time to publish my websites ? : Is it someth...

Strange. Deleted Journal and Time Clock
I just tried to do payroll and all of my payroll entries before 7/1/07 are gone. Also the journals before that date are also missing. All of my items are still in my register list. What gives? ...

Sort by state AND time zone?!
Calling all creative Excel users! I have client phone numbers in an Excel report, and want to somehow link the phone number to its time zone--and then sort the report by time zones! The purpose is to be able to assign outbound calls to staff at different times of the day, depending on time zone we are reaching I'm possibly an advanced beginner in the user of Excel, so don't be afraid to be VERY detailed in your suggestion for a formula! I don't know how to use pivot tables, by the way.. Many thanks Kay Provided you can find a list of area codes/time zones, you could use ano...

Count records b/w time range
I have a sheet which has data with date & time fields like this 19/10/2005 10:10 19/10/2005 11:30 19/10/2005 12:12 19/10/2005 12:15 19/10/2005 10:12 How do I make a formula to pull out count between each half hour slot? like: 10:00 - 10:30 =2 10:30 - 11:00 =0 11:00 - 11:30 =1 11:30 - 12:00 =0 12:00 - 12:30 =2 Please help. Cheers! Sunny =sumproduct(--(B1:B100>--"10:00:00"),--(B1:B100<=--"10:30:00")) -- HTH RP (remove nothere from the email address if mailing direct) <sunilkeswani@gmail.com> wrote in message news:1131569006.191782.216510@g44g200...

Accrue vacation & sick time
I am getting an error message when I try to accrue vacation and sick time in H/R accrue. The message reads - Cannot accrue attendance for a date that isn't within and accrual period. This will be the second payroll for the new year and I did not have any problems for the first payroll for 2010 ...

URGENT: Run Time Error '429' in Store Operations Administrator
I'm constantly getting a run-time error 429 - ActiveX can't create object - when trying to run Store Operations Administrator on my back office PC. The Store Operations Manager also fails on the back office PC - can't connect to database -. The register (POS) is still functioning as is the server where the RMS database resides. How do I fix this? I've never seen Active-X errors from Administrator. I'd try uninstalling RMS on that system then reinstalling it. Also make sure you apply whatever service pack you're running on your other systems. Sometimes POS ...

Formula to say Yes or No based on variance in time cells
Hi all, I have 2 time cells, F5 and I5, I want a forumla that will return the result Yes or No if there is a specified difference, 30mins for example. We have a spreadsheet with the same information coming from 2 sources and need to compare the information to say wether it is similar or not. Thanks in advance for any help Absolute difference? =IF(ABS(F5-I5)>=TIME(0,30,0),"Yes","No") -- HTH Bob Phillips "KingCreole" <shamble@gmail.com> wrote in message news:1117014247.379550.142950@z14g2000cwz.googlegroups.com... > Hi all, > > I have 2 ti...

Formular for Times
Hi Im looking for away to add working hour, that go into the nex day, eg. 22:30 till 07:15. =sum(B1-A1) only seems to work when hours are all in 1 day. Im using excel 2002 Any suggestions would be much appreciated ! Kenn -- Message posted from http://www.ExcelForum.com On Mon, 26 Jul 2004 05:40:00 -0500, Kenno <<Kenno.19zyom@excelforum-nospam.com>> wrote: >Hi >Im looking for away to add working hour, that go into the next >day, eg. 22:30 till 07:15. >=sum(B1-A1) only seems to work when hours are all in 1 day. >Im using excel 2002 > >Any sugges...

Mails delivered multiple times a day
Hi I�ve got the following problem hoping somebody here knows what can be done about it. There are two users on our exchange server (exchange 2000,service pack3) that get each one email multiple times a day. One email is a "deleted without being read" status notification to the user, the other one is a meeting request Let�s concentrate on the status notification. I paste a copy below (Please note the "xyz" I habe put in) -----Urspr�ngliche Nachricht----- Von: /O=XYZ/OU=GERMANY/CN=RECIPIENTS/CN=NKHELIFA Gesendet: Freitag, 3. September 2004 10:52 An: Schaika Volker Bet...

Template pagte date and time Stamp
On the default new page a current date and time stamp is created. Is there a way to use these stamps on a user created template --say located them elsewhere on the page -- for example a footer area? Stuball wrote: > On the default new page a current date and time stamp is created. Is > there a way to use these stamps on a user created template --say > located them elsewhere on the page -- for example a footer area? No, this is not possible. But you may insert date & time wherever you want (in addition). Rainald ...

Work to check for time remaining
We take care of few customer. All of them have Antivirus. Those anti-virus expire on a yearly basis. I create a new attribute call : AVExpirationDate. I want to have a workflow that check that and send an email to me and the customer 30 days before the expiration. Few month agon I post here on that, I was testing the crm on a lab, somebody told me how to figure the workflow. Now we run in a production CRM and I delete the temps install by mistake and cannot remember the way to do it. Can someone help me on recreating this. Hi David, You can do this using the Wait condition in Wo...

How do I calculate duty times
How do I calculate duty times and need to separate if any one is late and their overtime Hi, Take a look at C. Pearson web it has the answers you are looking for http://www.cpearson.com/excel/overtime.htm If this was helpful please say yes, thanks "Sala" wrote: > How do I calculate duty times and need to separate if any one is late and > their overtime ...

How to Calulculate Hrs and Mins between time frames
This is a multi-part message in MIME format. ------=_NextPart_000_0293_01C68406.3D280160 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable If i have 2 cells with time values say: A1=3D7:30AM and B1=3D3:30PM. 7:30AM - 3:30PM set to NORMAL Hours 3:30PM - 6:30PM set to TIME & HALF Hours Any time after 6:30PM - 7:29AM to be DOUBLE TIME hours Then if i set 4 other cells for data input: A2=3D( DATE 1) 29/5/2009 Start date. B2=3D(Date 2) 29/5/2006 = Finish date. A3=3D(Time) 7:30AM Start Time. B2=3D (Time) 7:00PM =...

Accounting for change in data over time
Please help, I'm having a brain freeze today, and I can't figure out what should be obvious. I have three tables: tblOrgs that holds information about an organization tblContacts that holds information about the peple that work at organizations tblMarketingRecords that hold marketing information about the organizations and the contacts that have been made. I need to account for two things that can change over time: the first is the person's title; the second is their association with the organizaion. In the first case, a person's title was Admin and is now Associate. ...

No date and time displayed
I am having a problem with the outlook. There are no date and time displayed on all my emails. When I received an email I should see date and time in the Received colume, but it's not there. Also, when I was trying to use the Calendar, date and time are not there too. I have updated my Outlook 2002 with SP-2. Can any one help? Thank you John ...

trys to send errornous emails every time
I have 2 errornous emails that could not be sent. Now everytime I try to send an email, Outlook trys to resend these 2 errornous ones, which takes forever and then I end up getting an error message. How do I get Outlook to stop trying to send these messages. PLEASE HELP!! If you know the answer to this question, pleas email me ASAP! Thanks! They should be in your Outbox folder. Delete them from the Outbox and try sending a new message. The new message should go through right away. - Seth "Sharla" <sharla0915@yahoo.com> wrote in message news:070501c3becb$fb409ca0...

time clock #3
There should be an option to print out a receipt on the pos printer every time someone clocks out This way the employee can see what time they must punch back in Or the total hours worked that day ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.c...

Wrong time zone in Outlook
We are in the Eastern time zone. We have someone in our office whose computer is set incorrectly to the Central time zone. Any time she makes an appointment, it's an hour off for the rest of us. (She does a workaround to make it come out right.) She would like to change her computer to the Eastern time zone, but this will move all the appointments ahead an hour, and she doesn't want to move them all back one at a time. The "Troubleshoot time zones" page says to export data from the Calendar folder, change the time zone setting, then import the data back. How c...

IE freezes when task time zeroed out
A user at a company I provide IT support for is having an issue where he will click into a cell to zero out an erroneous time entry and IE will instantly freeze, it has to be forcefully closed. It doesn't lock up the whole computer, just IE. We've tried upgrading IE, reinstalling the ActiveX controls, removing those, manually installing and registering them, everything we can think of, to no avail. Any ideas? TIA Brian: How about telling us what version of Project Server, IE, OS.. etc? -- Gary L Chefetz, MVP, MCT, MCITP msProjectExperts http://www.msprojectex...