[英]How can I automate the checkout of an excel spreadsheet from a sharepoint document library, edit the spreadsheet, and check it back in?
[英]How can I insert a picture into an Excel spreadsheet with Spreadsheet Light from a link rather than an image file?
使用Spreadsheet Light可以很容易地將圖片添加到表格中,如下所示:
SLPicture logoPic = new SLPicture(@"C:\Platypus\DuckbillsUnlimited.png");
logoPic.SetPosition(0, 13);
sl.InsertPicture(logoPic);
...但是我想在URL而不是文件中使用圖像。 如何完成的?
我嘗試直接在SLPicture的構造函數中使用圖像URL,但是不支持。 您可以使用以下解決方法:
對示例代碼的修改如下所示:
WebClient client = new WebClient();
client.DownloadFile(new Uri(url), @"C:\Platypus\DuckbillsUnlimited.png");
SLPicture pic = new SLPicture(@"C:\Platypus\DuckbillsUnlimited.png");
logoPic.SetPosition(0, 13);
sl.InsertPicture(logoPic);
不知道是否還有其他方法,但這絕對可行! 打開其他建議!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.