使用VBA设置Sharepoint标签/属性 [英] Set Sharepoint Tags/Properies with VBA

查看:242
本文介绍了使用VBA设置Sharepoint标签/属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用VBA设置Sharepoint文档(特别是Excel)的标签。目前,我知道处理这个的唯一方法是将文件保存到Sharepoint,在出现提示时设置标签,然后再次下载该文件并将其用作模板。

Is it possible to set the Tags of a Sharepoint document (specifically Excel) using VBA. At present the only way I know to handle this is to save a file to Sharepoint, set the Tags when prompted, nd then download this file again and use it as a template.

但是,我需要使用这些标签的几个不同的排版,而且每个人都需要创建一个单独的模板是一个很大的痛苦,特别是如果你需要修改模板,并且必须复制这些修正10次。

However, I need to work with several different permuations of these Tags and it's a major pain having to create a separate template for each one, especially if you then need to amend the template, and have to replicate those amendments 10s of times.

那么可以通过VBA来做到这一点吗?我已经尝试录制一个宏,而我设置它,它没有记录任何关于标签

So is it possible to do this via VBA? I've tried recording a macro whilst I set them and it doesn't record anything regarding the Tags

推荐答案

就我而言知道,我们可以在 VBA 中设置 Excel文档的标签,然后将其上传到Sharepoint库,
通过

As far as I know , we can set the Tags of an Excel document in VBA before it gets uploaded onto a Sharepoint library, by settings values for the

Workbook.ContentTypeProperties

例如:

 ActiveWorkbook.ContentTypeProperties("Line of Business").Value = pLine
 ActiveWorkbook.ContentTypeProperties("Company Name").Value = pCompany
 ActiveWorkbook.ContentTypeProperties("Year").Value = pYear

我会链接一些阅读以了解更多信息:这可能很有用:[John Chapman的SharePoint博客:从Excel VBA更新SharePoint文档属性]

I'd link some readings to learn more: It might be useful:[John Chapman's SharePoint Blog: Update SharePoint Document Property from Excel VBA]

http:// www.sharepointjohn.com/sharepoint-2007- --update-sharepoint-document-property-from-excel-vba /

http://www.sharepointjohn.com/sharepoint-2007-–-update-sharepoint-document-property-from-excel-vba/

请注意,有某些类型的财产有些麻烦:见
设置将在Sharepoint中使用的自定义文档属性这个线程

Please note that there are some troubles with certain types of property: see Setting Custom Document properties that will be used in Sharepoint and this thread

这篇关于使用VBA设置Sharepoint标签/属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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