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

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

问题描述

仅出于某种背景,我是一家公司的机械工程师,而这里的老人们在Access 2003中创建了一个数据库,该数据库基本上采用AutoCAD图形或Picture 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.

目前,我的问题是尝试检索表中嵌入的所有对象.我已经尝试将OLE保留到磁盘,但这似乎不适用于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".

我知道这是一个颇具争议的话题,因为我没有提供任何开始的代码,但是我认为这对我来说甚至太复杂了,我什至不能开始做.手工提取OLEObject是不可行的,因为有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?

预先感谢

拉斐尔.

推荐答案

如果您访问

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:\YourPath\YourDrawing.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天全站免登陆