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

I want to be able to have some macros, while writing in a Google Document.

The idea is to replace the Quick Parts in Word - so I can have the same functionality in a Google Document.

Any ideas?

share|improve this question

2 Answers 2

up vote 3 down vote accepted


Google lately added the Google Apps Script functionality in Google Documents and presented some basics on the Google Developers site.

One key feature is the sidebar. This is where the "Quick Parts" could reside. It needs however a bit of coding to do that. See the following example, made by Martin Hawksey: Sidebar

Update 27/07/2013, here's an example I wrote myself:


// global
var app = DocumentApp.getUi();

function onOpen() {
  app.createMenu('Quick Parts')
    .addItem('Document Property', 'docProperty').addToUi();

function docProperty() {
  // set variables
  var doc = DocumentApp.getActiveDocument(); 
  var fileName = doc.getName(), Id = doc.getId();
  var file = DocsList.getFileById(Id), lastUpdated = file.getLastUpdated();
  var fileOwner = file.getOwner().getEmail();

  // arrays with label and result names
  var aNames = ['File name', 'File Id', 'File Owner', 'Last updated by'];
  var aResults = [fileName, Id, fileOwner, lastUpdated];

  // create Ui  
  var Ui = UiApp.createApplication().setTitle('Quick Parts').setWidth(450);
  var vPanel = Ui.createVerticalPanel().setId('vPanel').setSize(450, 100);  
  var fTable = Ui.createFlexTable()

  // create labels
  for(var i=0, iLen=aNames.length; i<iLen; i++) {
    fTable.setWidget(i, 0, Ui.createLabel(aNames[i]));
    fTable.setWidget(i, 1, Ui.createLabel(aResults[i]));

  // add to Ui
  vPanel.add(Ui.createLabel().setText("Document Property")


enter image description here

share|improve this answer

I'm unfamiliar with Quick Parts specifically, but as to whether or not you can use macros in Google docs, they call them scripts, and you can access the script manager to make/edit scripts from Tools->Script Manager from inside a Google spreadsheet.

share|improve this answer
Is it available not in the spreadsheet? I need it in the docs. – Saariko Jun 26 '13 at 19:52
Ah, gotcha. Jacob's answer is going to be your better bet then for sure. – panhandel Jun 27 '13 at 17:35

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.