Can a Protected method that uses Extends be called outside of its module?

Let’s say I have a module called Module1 and within that module I have the following method:

Protected Sub Method1( Extends str as String )

Would it be possible to call that method outside of Module1? If so, what would be the syntax to call it? I know that within the module, I could include code that looks like this:

Dim s as String
s.Method1

But I can’t figure out how to call Method1 outside of the module while retaining Extends, other than changing Method1’s scope to Global.

(Surprisingly enough, this isn’t just an academic question, but something that would actually be practical for my current project.)

Yes, you have change it to Global. I prefer to give such methods a unique name to avoid future conflicts. In my case, I suffix all global methods with “_MTC”.

[code]Using Module1

Dim s as String
s.Method1[/code]

Thanks, Eli! I was unfamiliar with the Using keyword.

Well I’ll be, I had no idea that worked.

You can also add the using clause to a class or module by right clicking in the navigator on an item. Then the using clause acts like a namespace import. So if you use Method1 in several places within a window for example, you need only to add the using clause in the navigator to the window and then Method1 is automatically “visible” within the whole window and its controls for all strings.