有没有办法从表中的 OLEObject 字段中提取 AutoCAD 绘图和图片? [英] Is there a way to extract AutoCAD Drawings and Pictures from an OLEObject field in a table?

查看:17
本文介绍了有没有办法从表中的 OLEObject 字段中提取 AutoCAD 绘图和图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就一些背景而言,我是一家公司的机械工程师,这里的老人们在 Access 2003 中创建了一个数据库,该数据库基本上采用 AutoCAD 绘图或图片 OLE,然后将其放入带有一堆框架的精美报告中其他信息.我一直在对该数据库进行一些修改,其中之一是将所有 OLEObjects 存储为我们共享网络中实际文件的链接.过去一周左右添加到数据库中的每个新文件都已链接,这些人似乎已经掌握了窍门.

Just for some background, I'm a mechanical engineer at a company and the older folks here created a database in Access 2003 which basically takes an AutoCAD Drawing or a Picture OLE and plops it in a nicely framed report with a bunch of other information. I've been making some modifications to that database, one of which is to store all OLEObjects as links to actual files in our shared network. Every new file that has been added to the database for the past week or so has been linked and the guys seem to have gotten the hang of it.

此时我的问题是尝试检索嵌入表中的所有对象.我试过 Lebans OLE to Disk 但这似乎不适用于 AutoCAD 绘图(.dwg 和 .dxf 文件)也不适用于图片".

My problem at this point in time is to try and retrieve all the Objects that are embedded in the tables. I've tried Lebans OLE to Disk but that doesn't seem to work with AutoCAD Drawings (which are .dwg and .dxf files) nor does it work with "Picture".

我知道这是一个颇有争议的话题,因为我没有提供任何开始的代码,但我认为这太复杂了,我什至无法开始做,而且我已经不知所措了.手动提取 OLEObjects 是不可行的,因为其中有超过 8000 个分布在多个数据库中.有没有办法通过代码自动提取?

I know this is a quite controversial topic seeing as how I'm not providing any code to start with, but I think this is too complicated for me to even begin doing and I'm in over my head. Extracting the OLEObjects by hand isn't feasible since there's over 8000 of these spread through several databases. Is there any way to automate the extraction via code?

提前致谢,

拉斐尔.

推荐答案

如果您访问 Object 绑定对象框架控件的属性,对于 AutoCAD 绘图,这应该返回 AutoCAD 文档对象.然后您可以调用 SaveAs Document 对象的方法,用于将文件保存到已知位置.

If you access the Object property of the Bound Object Frame control, for an AutoCAD Drawing this should return the AutoCAD Document Object. You can then invoke the SaveAs method of the Document object to save the file to a known location.

例如,类似于:

With Me.MyBoundObjectFrame.Object
    .SaveAs "Drive:YourPathYourDrawing.dwg"
End With

其中 MyBoundObjectFrame 是绑定对象框架控件的名称.

Where MyBoundObjectFrame is the name of your Bound Object Frame control.

这在我有限的测试中很成功.

This works successfully in my limited testing.

这篇关于有没有办法从表中的 OLEObject 字段中提取 AutoCAD 绘图和图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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