ActiveX 文本框值

编程入门 行业动态 更新时间:2024-10-27 22:31:18
本文介绍了ActiveX 文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在 Word 中获取文本框的值?我知道在 excel 这是正确的语法:ActiveSheet.Shapes(x).Name.

How do I get the value of a textbox in Word? I know in excel this is the right syntax: ActiveSheet.Shapes(x).Name.

我认为在 word 这将是正确的语法ActiveDocument.Shapes(x).Name,但这似乎不起作用.

I thought in word this would be the right syntax ActiveDocument.Shapes(x).Name, but this doesn't seems to work.

使用这段代码我也找不到文本框:

With this piece of code I also couldn't find a textbox:

For i = 1 To ActiveDocument.Shapes.Count MsgBox ActiveDocument.Shapes(i).Name Next i

推荐答案

我使用标签(对象属性 -> 分配标签名称)来编辑对象的值.使用以下语法更改内容控件的值:ActiveDocument.SelectContentControlsByTag("Your-Content-Control-Tag").Item(1).Range.Text = "your-preferred-value"无论如何,感谢 Rachel Hettinger 的耐心;)

I used tags (object properties -> assign a tag name) to edit the object's value. Use this syntax to change the value of a content control: ActiveDocument.SelectContentControlsByTag("Your-Content-Control-Tag").Item(1).Range.Text = "your-preferred-value" Anyway, thanks Rachel Hettinger for your patience ;).

更多推荐

ActiveX 文本框值

本文发布于:2023-11-09 09:12:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571996.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本框   ActiveX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!