小编Nat*_*ely的帖子

如果我为Office 2007编写一个加载项,它是否适用于2010年,2013年?

我目前正在重写为Office 2003编写的一些VBA宏.我想知道我是否为2007年编写了一个C#插件,如果它可以在2010年或甚至2013年使用.或者如果我写它们2010年,如果他们也将在2007年和2013年工作.我目前可以访问2007年,但如果需要,我可以访问2010年,还有2013年.

那么,基本上,办公室的版本对插件有多大影响?

c# add-in office-2007 office-2010 office-2013

14
推荐指数
2
解决办法
9155
查看次数

Word BuiltInDocumentProperties不会更改

我在Word 2003中有一个宏,它将打开文档的属性字段应用于同一文件夹中的所有.doc.代码工作一次.如果我创建一个文件夹,在该文件夹中创建三个新文档,打开文档并运行宏,它将起作用.如果我在该文件夹中打开文档并再次运行宏,它只会更改运行宏的活动文档的属性.

宏位于Normal模板的模块中.

代码:

title = ActiveDocument.BuiltInDocumentProperties("Title")
subject = ActiveDocument.BuiltInDocumentProperties("Subject")
author = ActiveDocument.BuiltInDocumentProperties("Author")
manager = ActiveDocument.BuiltInDocumentProperties("Manager")
company = ActiveDocument.BuiltInDocumentProperties("Company")
category = ActiveDocument.BuiltInDocumentProperties("Category")
keywords = ActiveDocument.BuiltInDocumentProperties("Keywords")
comments = ActiveDocument.BuiltInDocumentProperties("Comments")

fileDirectory = ActiveDocument.Path

vFile = Dir(fileDirectory & "\*.doc")

Do While vFile <> ""
    Set wordDoc = Documents.Open(fileDirectory & "\" & vFile)
    With wordDoc
        .BuiltInDocumentProperties("Title") = title
        .BuiltInDocumentProperties("Subject") = subject
        .BuiltInDocumentProperties("Author") = author
        .BuiltInDocumentProperties("Manager") = manager
        .BuiltInDocumentProperties("Company") = company
        .BuiltInDocumentProperties("Category") = category
        .BuiltInDocumentProperties("Keywords") = keywords
        .BuiltInDocumentProperties("Comments") = comments
        .Save
        .Close
    End With
    vFile …
Run Code Online (Sandbox Code Playgroud)

vba word-2003

4
推荐指数
1
解决办法
8830
查看次数

标签 统计

add-in ×1

c# ×1

office-2007 ×1

office-2010 ×1

office-2013 ×1

vba ×1

word-2003 ×1