title: setSharing method on App Script not working for G Suite users?
body: <p>I am trying to create a document and set its access permissions. 
  The code below works on my normal Gmail account. </p>
  
  <p>However, when I run it on my unique GSuite address, it returns this error:</p>
  
  <blockquote>
    <p>TypeError: Cannot find function setSharing in object Document. (line
    6, file "Code")</p>
  </blockquote>
  
  <p>Here is the code:</p>
  
  <pre><code>    function createAndSendDocument() {
  
    //Create a new Google Doc named 'Hello, world!'
    var doc = DocumentApp.create('Hello World');
  
    //Set user permissions to view and edit.
    doc.setSharing(DriveApp.Access.ANYONE_WITH_LINK, DriveApp.Permission.EDIT);
  
    //Access the body of the document, then add a Paragraph.
    doc.getBody().appendParagraph('This is a test document for people to see and try and lorem ipsum.');
  
    //Get the URL of the doc
    var url = doc.getUrl();
  
    //Get email address of the active user - aka you.
    var email = 'example@domain.com';
  
    //Get the name of doc to use as an email subject line
    var subject = doc.getName();
  
    //Add a new strong to the url variable to use as an email body.
    var body = 'Link to your document: ' + url;
  
    //Send yourself an email with a link to the document.
    GmailApp.sendEmail(email, subject, body); 
  
  }
  </code></pre>
  
  <p>How can I work around this or use the setSharing method correctly? Am I using the wrong method or am I missing other steps as </p>