如何使用 vba 更改扩展文件属性 [英] How can I change extended file properties using vba

查看:44
本文介绍了如何使用 vba 更改扩展文件属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用此链接 我能够在 vba 中编写一个读取扩展文件属性的程序.现在,我想制作一个可以编辑扩展文件属性的程序——特别是属性 22,文件的主题".那么,给定文件路径,您如何编辑与该文件关联的主题?

Using this link I was able to write a program in vba that reads extended file properties. Now, I'd like to make a program that can edit extended file properties - specifically property 22, the "subject" of a file. So, given a file path, how could you edit the subject associated with that file?

推荐答案

使用你现在使用的方法无法完成.您可以安装和使用 Microsoft ActiveX dsofile.dll 使用 VBScript 获取和设置扩展属性.

It can't be done using the method you are using now. You can install and use the Microsoft ActiveX dsofile.dll to both get and set extended properties using VBScript.

Set objFile = CreateObject("DSOFile.OleDocumentProperties")
objFile.Open("C:\My Path\MyFile.doc")
objFile.SummaryProperties.Subject = "My Subject"
objFile.Save
set objFile = Nothing

这篇关于如何使用 vba 更改扩展文件属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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