快速将文件夹中的所有图像转换为相同的扩展名类型? [英] Quick way to convert all images in folder to the same extension type?

查看:91
本文介绍了快速将文件夹中的所有图像转换为相同的扩展名类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将word文档保存为已过滤的HTML文件后,我希望图片文件夹为所有.jpg或.png扩展名。有没有办法将它们全部转换为.png,最好?我知道你可以单独打开它们并使用差异扩展来重新保存它们但是我希望通过将代码编写到我的宏中来实现
快速方法。

After saving a word doc as a filtered HTML file I want the images folder to be in ALL .jpg or .png extension..is there a way to convert them all to .png, preferably? I know you can individually open them and resave them with a diff extension but I want a fast way to do this by writing code into my macro.

谢谢!

推荐答案

我使用程序调用ImageMagick(免费)。 它有一个.com接口,您可以从VBA调用它或发出命令行调用。 它很容易调用和转换图像。 我也用它来缩放图像和改变分辨率。 请记住向.com对象添加
引用。 格式由文件类型指定。

I use a program call ImageMagick (free).  It has a .com interface and you can call it from VBA or issue command line calls.  It is easy to call and convert images.  I also use it to scale images and change resolution.  Remember to add reference to .com object.  The format is specified by the file type.

函数ResizeImg(ByVal从As String,ByVal到As String)



Dim img As Object

设置img = CreateObject(" ImageMagickObject.MagickImage.1")

msg =  ; img.Convert(From,to)

结束函数


这篇关于快速将文件夹中的所有图像转换为相同的扩展名类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆