[英]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.