Note that there are some explanatory texts on larger screens.

plurals
  1. POCopy a Google Docs Spreadsheet using Google .NET API
    primarykey
    data
    text
    <p>I'm wanting to copy an already existing Google Docs Spreadsheet to a new Google Docs spreadsheet. I dont think the <strong><a href="http://code.google.com/intl/en/apis/documents/docs/2.0/developers_guide_dotnet.html" rel="nofollow noreferrer">v2.0 .NET API</a></strong> can handle it natively (or if so I can't find the class/method), however It looks like the <strong><a href="http://code.google.com/intl/en/apis/documents/docs/3.0/developers_guide_protocol.html#CopyingDocs" rel="nofollow noreferrer">v3.0 protocol</a></strong> can but I'm not sure how to implement this in the current framework or even if it is possible with the current .net api. eg. ~DocumentsFeed.copy() (pseudo code).</p> <p>Exporting to a temp excel file then uploading with a new name is not possible either as some of the complex formulas get messed up in the conversion process.</p> <p>I am a bit of a .NET noob so any info would be greatly appreciated eg. How would I go about doing this in .NET if I could only use the v3 protocol (ajax etc) and not the .NET API.</p> <p>Thanks</p> <p>EDIT: (final class thanks to @langsamu for his help!)</p> <pre><code>using System; using Google.GData.Documents; using Google.GData.Client; using Google.GData.Extensions; public class GoogleDocument { private DocumentsService ds; private String username; private String password; public GoogleDocument(String username, String password) { this.ds = new DocumentsService("doc service name"); this.username = username; this.password = password; this.ds.setUserCredentials(username, password); this.ds.QueryClientLoginToken(); } public void copyDocument(String oldFileName, String newFileName) { SpreadsheetQuery query = new Google.GData.Documents.SpreadsheetQuery(); query.Title = oldFileName; query.TitleExact = true; DocumentsFeed feed = this.ds.Query(query); AtomEntry entry = feed.Entries[0]; entry.Title.Text = newFileName; var feedUri = new Uri(DocumentsListQuery.documentsBaseUri); this.ds.Insert(feedUri, entry); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload