英文:
Suppress or close automatic dialogue boxes when dropping shapes (specifically off-page reference) visio vba
问题
我正在以编程方式添加页面并在文档的主标题页上添加引用。这一切都运行正常;但是,在宏完成后,会弹出许多对话框,询问我是否要创建新页面并将链接的跨页引用放到该页面上。我正在以编程方式设置链接、名称等等。
我已经尝试设置 application.AlertResponse = 2
(其中2是IDCANCEL)以取消弹出的对话框,但没有成功,并且没有找到与此问题相关的任何信息在线上。有人对此有任何建议吗?
英文:
I am programatically adding pages and adding references to those pages on the main title page of a document. This all works fine; however, after the macro finishes many dialogue boxes pop up asking whether I want to create a new page and drop a linked Off-page ref to that page. I am setting links, names, etc. programatically.
I have tried to set the application.AlertResponse = 2
(where 2 is IDCANCEL) to cancel the boxes as they pop up with no luck and haven't been able to find anything related to this issue online. Anyone have any input for me?
答案1
得分: 2
-
如果你在代码的最开始设置 Application.AlertResponse = 2,我相信那应该可以解决。
-
请注意,离页连接器形状是设计成按照它目前的方式工作的,在大多数情况下都是有道理的。你可以尝试通过创建你自己版本的离页连接器形状来禁用对话框(例如,通过创建默认版本的副本并编辑它,使其不显示对话框)。默认版本使用“事件拖放”形状表格单元格来显示对话框。因此,如果你在你的离页连接器版本中清除了该单元格,当你拖放你的版本时将不会显示对话框。
英文:
-
If you set Application.AlertResponse = 2 at the very beginning of your code, that should work, I believe.
-
Note that the off-page connector shape is designed to work the way it does, and in most scenarios it makes sense. You could be able to disable the dialogs by creating your own version of the off-page connector shape (e.g. by creating a copy of the default one and editing it so that it does not show that dialog). The default one shows the dialog using the "Event Drop" shape sheet cell. So if you clear that cell in your version of the off-page connector, no dialog will be shown when you drop your version.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论