Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a word processing document that will be used by many people (a style sheet for writers), and will also be updated periodically. I suspect that well have some who print the document out for reference. Is it possible in Google Documents to put field codes in the footer that indicate the print date or the save date? If not, maybe we could name the document "[document title] version [x]" and have that print in the footer?

share|improve this question
Nearly identical question, asked two years after this one: stackoverflow.com/questions/13585272/… – yurkennis Feb 9 '15 at 14:30
up vote 2 down vote accepted

Alas, this doesn't seem possible right now; Google Docs doesn't support the auto-updating fields that Office does.

Here is a support thread where you can request this feature, though - I've also posted a reply on it.

share|improve this answer
Thanks; I added a comment as well. That thread did tell me how to add a page count (i.e., page X of Y), that would have been my next question! – neilfein Sep 7 '10 at 21:33
Unfortunately, that link is now out of date. – neilfein May 11 at 2:38

Yes, it is possible. However, it is not something that is really possible utilizing the existing API. Really the lack of fields and the associated capabilities like in Word is a major disability for document automation.

Something like this will insert a footer on document open and reopen, but it is ultimately not a good solution.

function onOpen() {
    var time = new Date();
    time = Utilities.formatDate(time, "GMT", "yyyy-MM-dd'T'HH:mm:ss'Z'");
    var doc = DocumentApp.getActiveDocument();
    var s;

    if (!doc.getFooter()) {
        var footer = doc.addFooter();
        var footerText = footer.appendParagrap(time);
    } else {
        var footer = doc.getFooter();
        var footerElements = footer.getNumChildren();
        var para = footer.getParagraphs();
        s = para[footerElements-1].getText();
        var footerText = footer.replaceText(s , time);

EDIT: How to add the script.

This code as I have presented above really should be in its own function called from the OnOpen() function rather than in there wholesale, but all good for example purposes.

If you go the Tools menu of an open document then down to Script Manager, when it loads check that it is currently empty, if has a records there, you are on your own for placement of the code.

Close the script manager, back to the Tools Menu and select Script Editor. Now if you had nothing in your script manager, select all the code and delete it. You can then paste in the code provided above and then save it.

Close the document and re-open and you should find there is now a Time Date in the footer. It should update on every open of the document, nothing fancy but will get you going.

Now for those of you who have code already associated with your document. Adding the code above minus the first and last lines into the onOpen() function will also work, but it may not due to code already present conflicting.

Hope this gets you going.

share|improve this answer
Perhaps you can tell the folks how to add the script? – Jacob Jan Tuinstra Jul 22 '13 at 13:34
@JacobJanTuinstra I updated the response, I hope this helps. – jCisco Jul 23 '13 at 0:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.