Hi Kerstin,
no, the error only occurs if the object *before* the dot is nothing because
you never can call a method of Nothing.
In this case that means obj is Nothing, thus you can't call its Controls
property. (If Controls itself were Nothing that would be ok because it's ok
to set an object variable = Nothing.)
So, you need to figure out how the page you're looking for is named.
ModifiedFormPages("S.2") doesn't exist. Probably you can do that by
accessing each page by its index, then look for the name of the returned
object.
Best regards
Michael Bauer - MVP Outlook
: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>
Am Tue, 24 Nov 2009 13:35:08 +0100 schrieb Kerstin Schiebel:
> Hi Michael,
>
> thank you very much for your perseverance ;-)
>
> "Michael Bauer [MVP - Outlook]" <mb@mvps.org> schrieb im Newsbeitrag
> news:1wtkfb8fp83bk.7rcgf6zexy4w$.dlg@40tude.net...
>>
>>
> ...
>> set obj=obj.Controls <--- this is the problem!
>
> because at this time there is no control on the page???
> On page 'S.2' is nothing, I want to add the first control.
>
> Regards
> Kerstin