开发者

Automating Word to insert an image from a URL

开发者 https://www.devze.com 2022-12-20 07:23 出处:网络
from Automation in jscript how can I programatically insert an image into Word (2000+) from a URL? The url also is quite long, around 400 characters, and I\'ve read that Word 2007 has a problem some

from Automation in jscript how can I programatically insert an image into Word (2000+) from a URL?

The url also is quite long, around 400 characters, and I've read that Word 2007 has a problem sometimes with strings longer than 255 characters.

I've used this successfully except that it won't allow urls longer than 255 characters:

    var oDialog = oWordDoc.Application.Dialogs( wdDialogInsertPicture );
    oDialog.Name = imag开发者_如何转开发eUrl;
    oDialog.LinkToFile = false;
    oDialog.FloatOverText = true;
    oDialog.Execute();


I don't have a > 255 char url to test it with, but try this:

oWordDoc.Shapes.AddPicture(imageUrl, false);
0

精彩评论

暂无评论...
验证码 换一张
取 消