An Illustrative VBA Application

In this chapter we will develop a real-life application involving the use of AutoCAD and Microsoft Word. Executed from AutoCAD, this application will accomplish the following list of tasks:

• Open Microsoft Word.

• Create a table with the appropriate number of columns.

• Make adjustments to various table parameters.

• Fill the table with AutoCAD layer data.

Additionally, many small details not in the list will be explained throughout this chapter. Our goal is to finish with an application that has a user interface like the one shown in Figure 22-1, and an output like that shown in Figure 22-2.

Figure 22-1. A sample user interface

Layer Report for C:\Documerits and Settings\joesu\My Documents\Drawing ldwg

Name

On

Frozen

Locked

Color

Linetype

Lineweight

Style

Flotable

0

Yes

No

No

White

Continuous

Default

ByColor

Yes

Figure 22-2. Sample output

Reporting on the layers and their settings is a fairly common requirement, especially if you work with clients. Many times the customer wants something with a specific format and typeface. This chapter will give you the skills to further develop the application into exactly what your clients desire.

Was this article helpful?

0 0

Post a comment