Popup Box with Link to other google Document in Google Document -


I have a script that I run from a Google Document menu. This essentially works like this:.

I want a function that is one of the links above, except that the popup with that link is shown in Google Docs instead of Google Spreadsheets. The part of my script looks like this (the title and url are defined above that part):

  var docnew = DocumentApp.getActiveDocument (); Var app = UiApp.createApplication (). SetTitle ("Open Doc") .setHeight (50) .setWidth (400); Var vPanel = app.createVerticalPanel () Add (app.createAnchor (title, url)); App.add (vPanel); Docnew.show (app);   

I get the following error then

Can anyone help me with this?

"TypeError: Objekt document nicht gefunden in the function widget", which is German and which means "Type error: Function show object not found in document".

Thank you very much from the very first time.

Best,

Phil

Show method is only Google The document works in the spreadsheet in the document (and in the new version of the spreadsheet), you can use this code:

  SpreadsheetApp.getUi (). ShowModalDialog (logic);   

Shows some examples.

Your code snippet will:

  function showUi () {var docnew = DocumentApp .getActiveDocument (); Var app = UiApp.createApplication () .setHeight (50) .setWidth (400); Var vPanel = app.createVerticalPanel () Add (app.createAnchor (title, url)); App.add (vPanel); DocumentApp.getUi (). ShowModelessDialog (app, "Open Doc"); }    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -