microsoft.office.interop.word.document ...找到在sharepoint中创建文档的位置 [英] microsoft.office.interop.word.document… find to where document is being created from in sharepoint
问题描述
好的,所以我对从SharePoint(2013)中的自定义内容类型创建新文档时运行的Word 2016插件有一个相当具体的查询。
当用户从中创建新文档时在内容类型中,我的插件需要针对用户创建文档的库运行一些功能。此时,文档本身有
没有保存。
所以我正在寻找的是Word中的位置 - 它必须在某处,因为当我选择保存时它知道显示我创建的文档库 - 在 microsoft.office.interop.word.document
API
这是存储的吗?我已经浏览了以下属性但是迄今为止没有发现任何内容:
Microsoft.Office.Interop.Word.Document.Path //由于文件未保存,因此不包含任何内容
Microsoft.Office.Interop.Word.Document.Name
Microsoft.Office.Interop.Word.Document.FullName
Microsoft.Office.Interop.Word.Document.Application.Path
Microsoft.Office.Interop.Word.Document.DocumentLibraryVersions
Microsoft .Office.Interop.Word.Document.BuiltInDocumentProperties
Microsoft.Office.Interop.Word.Document.ContentTypeProperties
Microsoft.Office.Interop.Word.Document.DocumentLibraryVersions
Microsoft.Office.Interop。 Word.Document.SharedWorkspace
路径不包含尾随字符 - 例如,"C:\ MSOffice"或" http:// MyServer "。使用P:Microsoft.Office.Interop.Word._Application.PathSeparator
属性添加分隔文件夹和驱动器的字符使用Name属性返回不带路径的文件名,并使用FullName属性一起返回文件名和路径。
所以我建议你使用Microsoft.Office.Interop.Word.Document.Name& Microsoft.Office.Interop.Word.Document.FullName来返回路径。
问候,
蔚
OK, so I've a fairly specific query regarding a Word 2016 addin that is running when a new document is created from a custom content type in SharePoint (2013).
When the user creates a new document from the content type, my addin needs to run some functions against the library from where the user is creating the document. At this point, the document itself has NOT been saved.
So what I'm looking for is where in Word - and it must be in there somewhere as when I select save it knows to show the library I created the doc from - in the microsoft.office.interop.word.document
API
is this stored? I've trawled through the following properties but have uncovered nothing to date:
Microsoft.Office.Interop.Word.Document.Path //Doesn't contain anything yet as the file isn't saved
Microsoft.Office.Interop.Word.Document.Name
Microsoft.Office.Interop.Word.Document.FullName
Microsoft.Office.Interop.Word.Document.Application.Path
Microsoft.Office.Interop.Word.Document.DocumentLibraryVersions
Microsoft.Office.Interop.Word.Document.BuiltInDocumentProperties
Microsoft.Office.Interop.Word.Document.ContentTypeProperties
Microsoft.Office.Interop.Word.Document.DocumentLibraryVersions
Microsoft.Office.Interop.Word.Document.SharedWorkspace
Hi,
According to Document.Path Property:
The path does not include a trailing character—for example, "C:\MSOffice" or "http://MyServer". Use the P:Microsoft.Office.Interop.Word._Application.PathSeparator property to add the character that separates folders and drive letters. Use the Name property to return the file name without the path and use the FullName property to return the file name and the path together.
So I suggest you use Microsoft.Office.Interop.Word.Document.Name & Microsoft.Office.Interop.Word.Document.FullName to return the path.
Regards,
Celeste
这篇关于microsoft.office.interop.word.document ...找到在sharepoint中创建文档的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!