使用 Word ContentControl DatePicker 如何获取值? [英] With a Word ContentControl DatePicker how do i get the value?
问题描述
我有一个 ContentControl,它是 Word 文档中的 DatePicker.我正在尝试使用它在后面的代码中填充一些值,但我似乎无法从中获取值.
I have a ContentControl that is a DatePicker in a word document. I'm trying to use it to populate some value in a code behind but I cant seem to get the value out of it.
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, _
Cancel As Boolean)
ContentControl 上的所有属性都不接近 .Value 或 .Text.我见过其他内容控件的使用:
None of the properties on ContentControl are close to .Value or .Text. I have seen other content controls use:
ContentControl.DropdownListEntries(1).Text
ContentControl.DropdownListEntries(1).Value
正如 DatePicker 所预期的那样,这不起作用,但它是 ContentControl 的唯一属性,可以返回任何接近我想要的值.
This, as expected for a DatePicker, does not work but it is the only property of ContentControl that returns anything close to the value I want.
如何从 DatePicker ContentControl 获取日期?
How do i get the date from the DatePicker ContentControl?
推荐答案
这是您要尝试的吗?
Private Sub Document_ContentControlOnExit(ByVal ContentControl _
As ContentControl, Cancel As Boolean)
MsgBox ContentControl.Range.Text
End Sub
快照
这篇关于使用 Word ContentControl DatePicker 如何获取值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!