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

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

问题描述

是否可以使用 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 设置共享点标签/属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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