Group:  Microsoft Word ยป microsoft.public.word.oleinterop
Thread: How to obtain DWG file from OLE object?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

How to obtain DWG file from OLE object?
"sahmad" <sahmad576[ at ]gmail.com> 05.06.2006 10:31:04
Hello All,

I am writing a console based application using C# in which I want to
implement a feature which could extract OLE objects from Word documents
and then save it in DWG file format. The OLE objects exist in Word
documents are in the form of AutoCAD Drawing i.e. once I double clicked
the Object; the system opens it in AutoCAD 2000.

Currently I have accessed the OLE object through "Word.InlineShape"
object by using Word Interop API but couldn't find any way to save it
in AutoCAD supported DWG file format. Does any one have any idea how
can I obtain a DWG file through the OLE object?

Although I have extracted the OLE object in a BMP file by using
"Selection.EnhMetaFileBits" property but the requirement is to be
saved in DWG file format. I'll be grateful if any one could help.

Thanks in advance!
-Shehzad

RE: How to obtain DWG file from OLE object?
Cindy Meister 17.06.2006 14:43:02
If you've accessed the OLE Object, through OLEFormat, you should be able to
perform DoVerb() on it to open it in its "parent" application. Then -
assuming AutoCAD has an automation interface - you send the necessary
automation commands through the object. If this were an Excel chart, for
example, I'd use objWorkbook.SaveAs with the necessary parameters to save in
whichever file format.

No idea about the AutoCAD object model, or even if it has one.
--
-- Cindy


"sahmad" wrote:

[Quoted Text]
> Hello All,
>
> I am writing a console based application using C# in which I want to
> implement a feature which could extract OLE objects from Word documents
> and then save it in DWG file format. The OLE objects exist in Word
> documents are in the form of AutoCAD Drawing i.e. once I double clicked
> the Object; the system opens it in AutoCAD 2000.
>
> Currently I have accessed the OLE object through "Word.InlineShape"
> object by using Word Interop API but couldn't find any way to save it
> in AutoCAD supported DWG file format. Does any one have any idea how
> can I obtain a DWG file through the OLE object?
>
> Although I have extracted the OLE object in a BMP file by using
> "Selection.EnhMetaFileBits" property but the requirement is to be
> saved in DWG file format. I'll be grateful if any one could help.
>
> Thanks in advance!
> -Shehzad
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net