使用Visual Basic删除特定文本框 [英] Deleting a specific text box using Visual Basic

查看:132
本文介绍了使用Visual Basic删除特定文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两个文档属性值的文本框。这些值已重新定位,现在必须删除文本框,而不仅仅是清除,而是删除。文本框在文档的封面上显示,它在正文中,而不是
标题。


如何做到最好?我是否需要识别此文本框的对象编号,如果是,如何?

是否有任何简单的脚本可以删除此单个文本框。我不能确定 如果用户在同一页面上添加了其他文本框,那么删除所有文本框不是一个好主意。


谢谢


Robin

解决方案

我已设法使用


ActiveDocument.Shapes( 1)。删除


但是如果脚本再次运行它肯定会删除下一个文本框,这个文本框将是不能删除的内容的一部分,所以我仍然卡住这里。如果我可以将其限制为删除第1页上的文本框,即封面页,那么
将是可用的,接受没有人在那里放置其他文本框。


罗宾


I have a Text Box that contains values from two document properties. These values have been repositioned and the text box must now be removed, not just cleared, but deleted. The Text Box apears on the cover page of the document, it is in the body, not the header.

How do I best do this? Do I need to identify the object number of this Text Box and if so how?
Is there any easy script to delete this single Text Box. I cannot be sure if users have added other Text Boxes on the same page, so a deletion of all Text Boxes is not a good idea.

thanks

Robin

解决方案

I have managed to delete this using

ActiveDocument.Shapes(1).Delete

but if the script is run again it will definitely delete the next text box, which would be part of the content that must not be deleted, so I'm still stuck here. If I could limit it to deletion of the text box on page 1, that is the cover page, then that would be usable, accepting that no one has placed other text boxes there.

Robin


这篇关于使用Visual Basic删除特定文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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