Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can open a text file when I open a dwg file with autocad?

Status
Not open for further replies.

doda78

Programmer
Oct 8, 2003
1
IT
Hi ,
I'making an application with VBA in Autocad.
I need to save a file NAME, with PATH, of a text file on the dwg file.
I would to open this file on the AcadDocument_Activate event.

Thanks,
Andrea
 
Hi,

Try adding this code to the AcadDocument_Activate() event.....

Code:
Dim retval As Variant
retval = Shell("C:/Windows/notepad.exe " & "C:/filename.txt", vbNormalFocus)

...changing the "C:/filename.txt" for the correct path and filename of the text file you want to load..
With the vbNormalFocus bit, the text file will open infront of the AutoCAD window but not maximised - only about half screen size..

Anyway, I hope this helps..

Cheers,

Paul @ basepoint designz..


basepoint designz
renegade@tiscali.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top