![]() |
|
#5
|
|||
|
|||
|
Thank you for the reply. However, I was not able to get the code to run.
Quote:
Code:
Set AcadDoc = .Documents.Open("C:\drawing.dxf")
I found another solution. I placed the export code into AutoCAD and called it from Word. For anyone who might need it, the solution I found is below. Code in Word: Code:
Sub Convert_dxf()
Dim AcadApp As Object
On Error Resume Next
Set AcadApp = GetObject(, "AutoCAD.Application")
If Err.Number <> 0 Then
Set AcadApp = CreateObject("AutoCAD.Application")
End If
AcadApp.Visible = False
AcadApp.Documents.Open ("C:\drawing.dxf")
AcadApp.RunMacro "Convert_drawing"
AcadApp.ActiveDocument.Close savechanges:=False
If AcadApp.Documents.Count = 1 Then
AcadApp.ActiveDocument.Close savechanges:=False
AcadApp.Quit
End If
Set AcadApp = Nothing
End Sub
Code:
Sub Convert_drawing()
Dim SS As AcadSelectionSet
Set SS = ActiveDocument.SelectionSets.Add("SSet")
SS.Select acSelectionSetAll
ActiveDocument.Export "C:\drawing", "WMF", SS
Set SS = Nothing
End Sub
|
| Tags |
| auto export, autocad, vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do you convert to .MOV? | pmr8888 | PowerPoint | 0 | 11-30-2011 04:32 PM |
| Outlook 2010 attach autocad drawing | knorre | Outlook | 0 | 10-31-2011 12:46 AM |
| Pasting into worksheet from Autocad for Mac | davisb | Excel | 0 | 08-29-2011 01:59 PM |
| Access, Visio & Autocad | oo0tommyk0oo | Visio | 0 | 05-16-2011 02:46 PM |
embed autocad drawing in word document prints very light
|
gbehm@broan.com | Drawing and Graphics | 1 | 03-15-2011 08:05 PM |