How to publish Google Docs in .NET?

后端 未结 2 1707
孤独总比滥情好
孤独总比滥情好 2021-01-06 10:04

I\'m using the google-gdata .NET library for integrating with Google Docs. It\'s working out pretty well, but I can\'t figure out how to use it to publish my documents for v

2条回答
  •  广开言路
    2021-01-06 10:53

    I just updated the .NET client library, now you can use the following code to publish a revision (it assumes entry is the DocumentEntry instance you want to publish):

    RevisionQuery revisionQuery = new RevisionQuery(entry.RevisionDocument);
    RevisionFeed revisions = service.Query(revisionQuery);
    
    // TODO: choose the revision you want to publish, this sample selects the first one
    RevisionEntry revision = (RevisionEntry)revisions.Entries[0];
    
    revision.Publish = true;
    revision.PublishAuto = true;
    
    revision.Update();
    

提交回复
热议问题