
To move text, you delete it in one location and then insert it at another Again, writingīackwards can simplify your handling of indexes. Text alters the indexes of all the text "below" in the segment. Simplify matters by writing backwards. As with insertions, deleting Result = service.documents().batchUpdate(ĭocumentId=DOCUMENT_ID, body=).execute() $response = $service->documents->batchUpdate($documentId, $batchUpdateRequest) $batchUpdateRequest = new Google_Service_Docs_BatchUpdateDocumentRequest(array(

$requests = new Google_Service_Docs_Request(array( batchUpdate(DOCUMENT_ID, body).execute() setLocation(new Location().setIndex(75)))) īatchUpdateDocumentRequest body = new BatchUpdateDocumentRequest().setRequests(requests) īatchUpdateDocumentResponse response = docsService.documents() setLocation(new Location().setIndex(50)))) setLocation(new Location().setIndex(25))))


Requests.add(new Request().setInsertText(new InsertTextRequest()
