Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We want to add powerpoint slides from google drive to existing slide programmatically. We are using powerpoint add-in project type from VS. Is there any way to achieve this?

I have below code which just redirects me to Gmail for login but not does anything after login.

What I have tried:

UserCredential credential;
using (var stream =
new FileStream("credentials.json", FileMode.Open, FileAccess.Read))
{
string credPath = "token.json";
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
Scopes,
"user",
CancellationToken.None,
new FileDataStore(credPath, true)).Result;
Console.WriteLine("Credential file saved to: " + credPath);
}

// Create Drive API service.
var service = new DriveService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = ApplicationName,
});
Posted
Comments
Christian Graus 4-Oct-18 1:42am    
I don't see any code to download files or add them to powerpoint?
[no name] 4-Oct-18 6:41am    
I have referred code from https://developers.google.com/drive/api/v3/quickstart/dotnet

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900