0
SharePoint Online Webサイトからユーザーのプロファイルイメージをダウンロードし、そのイメージをPPTに挿入する必要があります。このため、私は以下のC#コードを使用しています:C#を使用してSharePoint Online Webサイトからユーザーのプロファイルイメージをダウンロード
string userPhotoURL = "https://microsoft.sharepoint.com/_layouts/15/userphoto.aspx?size=M&[email protected]";
using (var client = new WebClient())
{
client.Headers.Add("User-Agent: Other");
client.Credentials = Utility.GetSharePointOnlineCredentials(); // includes username and SecureString password
client.DownloadFile(userPhotoURL, "D:\sample.jpg");
}
// More code to read the D:\sample.jpg and insert it into PPT
しかし、上記は403応答を返しています。
注:サーバー側からこれを達成する必要があります。