Scope of an Imports statement

  • Thread starter Thread starter Howard Kaikow
  • Start date Start date
H

Howard Kaikow

I was doing some testing of the effect of Option Strict on particular Word
VBA statements.

So I created a Form, the events of which called Subs in separate Modules.
Each Module is in a separate file so I can have a different Option Strict in
each.

I then noticed that I had to include an identical Imports statement in each
of the 3 files.

Is there a way to give an Imports statement the scope of the Project?
 
Howard,

Howard Kaikow said:
Is there a way to give an Imports statement the scope of the Project?

In the project properties you can define project-wide imports.
 
Howard Kaikow said:
I was doing some testing of the effect of Option Strict on particular Word
VBA statements.

So I created a Form, the events of which called Subs in separate Modules.
Each Module is in a separate file so I can have a different Option Strict in
each.

I then noticed that I had to include an identical Imports statement in each
of the 3 files.

Is there a way to give an Imports statement the scope of the Project?

Yes, if you are using Visual Studio.NET, show the properties of the
project, go to 'Common properties' -> 'Imports' and add one or more
project imports.
Anyway, projectwide imports is an option of the vbc compiler and can
be set from command line.
 
Back
Top