VBA从Access控制Viso [英] VBA to Control Viso from Access

查看:96
本文介绍了VBA从Access控制Viso的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不是将一组形状从模板中的主形状拖动到绘图页面上,而是使用Visio数据库向导将每个形状单独链接到外部数据源(Access,Excel等),而不是直接从外部数据源生成形状
到绘图页面的方法? 
$


这种情况​​涉及到我已经拥有的一套建筑材料创建了一个模板,主要形状代表屋顶板,排水沟,柱子等。我可以将主屋顶板拖到页面上,并在边界内更改其长度和宽度
(我在Master Shape Sheet),我可以从形状数据中固定的颜色选择列表(下拉列表)中选择此工作表的特定颜色。



我可以将所有组件逐个放置到绘图页面上,然后将尺寸和颜色调整为我对此绘图所需的内容,然后通过报告功能将它们导出到XL,或通过数据库向导将它们链接到外部数据源。但是
这个必须一次完成一个组件并且非常耗时并且容易出现操作员错误。 



现在,实际的建筑物要使用的组件最初是在Access数据库中创建的,具有特定的长度和宽度(在相同的Visio主体形状边界内)和颜色。



我的问题是,我可以使用MS Access告诉Visio依次获取我需要的每个Visio Shape master,并在页面上放置一个形状(无论在哪里,我可以稍后移动它们)基于Master Shape定义和Access中的数据为该记录?
我设想这是一步一步的行动;比如运行Access查询或VBA Recordset,在一次操作中,将所有形状放在Visio页面上。其中一个项目的示例可以是9米×800毫米未选择颜色的主屋顶板,
但是此结构的Access数据库所需的屋顶板为3米X 750毫米,具体为颜色(红色)。这应该是页面上显示的形状。



作为最后一步,如果可以将Visio数据同步回Access数据库,那将是很好的,如果操作员决定在Visio绘图上更改屋顶板的长度,例如,从3米到4,这也将更新Access
数据库记录。

Rather than dragging a set of shapes onto a drawing page from the master shapes in a stencil and then using the Visio database wizard to individually link each shape to an external data source (Access, Excel, etc.), is there a way to generate the shapes onto the drawing page directly from the external data source? 

The situation involves a set of building materials that I have already created a stencil for, with master shapes that represent things like roofing sheets, gutters, posts, etc. I can drag a master roofing sheet onto the page and change its length and width within bounds (that I have set in the Master Shape Sheet), and I can choose a specific colour for this sheet from a fixed selection list of colours (drop-down) in the shape data.

I COULD place all the components onto the drawing page, one by one, then adjust the sizes and colours to what I need for THIS drawing and then export them via the reporting function to XL, or link them via the database wizard to an external data source. But this would have to be done one component at a time and is very time consuming and prone to operator error. 

Now, the actual building components to be used are initially created in an Access database, complete with the specific lengths and widths (within the same Visio Master Shape bounds) and colour.

My question is, can I use MS Access to tell Visio to take each Visio Shape master that I need, in turn, and place a shape onto the page (doesn't matter where, I can move them later) based on that Master Shape definition and the data in Access for that record? I envisage this to be a one step action; like run an Access query or VBA Recordset that, in one operation, places all the shapes on the Visio page. An example of one of the items could be a master roof sheet that is 9 metres X 800 mm with no colour selected, but the roof sheet required by the Access database for this structure is 3 metres X 750 mm with a specific colour (red). That should be the shape that appears on the page.

As a final step it would be nice if the Visio Data could be synchronised back to the Access database so that if the operator decided change the length of the roof sheet on the Visio drawing, for instance, from 3 metres, to 4, this would also update the Access database record.

推荐答案

是的,这是不可能的 - 丢弃形状!

Yes, it is impossible - drop shapes !

我不熟悉MS Access,通常我有Excel工作簿,其中存储了masternames和参数集。

I not familiar with MS Access, usually i have Excel workbook where stored masternames and sets of parameters.

您可以与您的数据共享简单的Access DB吗?

Can you share simple Access DB with your datas?

您可以找到Visio BackSync加载项

You can find Visio BackSync add-in

< a href ="http://unmanagedvisio.com/products/visio-back-sync/"> http://unmanagedvisio.com/products/visio-back-sync/


这篇关于VBA从Access控制Viso的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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