It still does not work. The error I keep getting is:
Run-time error '438':
Object doesn't support this property or method
It does create the new layout but it just won't switch to it
Tony Tanzillo wrote in message <
[email protected]>...
>My guess is that it may be failing because the form is
>active. You might want to try closing the form first,
>before trying to make the layout active.
>
>Michael Browne wrote:
>>
>> Tony,
>>
>> That doesn't want to work either. Here's my code. Its inside a form
that
>> has a textbox
>> and two buttons
>>
>> Private Sub CommandButton1_Click()
>>
>> Set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
>>
>> Unload Me
>> End Sub
>>
>> Thanks for the help
>> Michael Browne
>>
>> Tony Tanzillo wrote in message <
[email protected]>...
>> >Try posting the code you're having the problem with,
>> >as it's hard for someone to guess what it does.
>> >
>> >Otherwise, this should do it:
>> >
>> >set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
>> >
>> >Michael Browne wrote:
>> >>
>> >> I'm having a hard time adding a layout then making the new layout
>> current.
>> >> I can add the new one just fine, but I can't get it to become active
>> using
>> >> code.
>> >>
>> >> Thanx in advance
>> >> Michael Browne
>> >
>> >--
>> >/*********************************************************/
>> >/* Tony Tanzillo Design Automation Consulting */
>> >/* Programming & Customization for AutoCAD & Compatibles */
>> >/* ----------------------------------------------------- */
>> >/*
[email protected] */
>> >/* http://ourworld.compuserve.com/homepages/tonyt */
>> >/*********************************************************/
>
>--
>/*********************************************************/
>/* Tony Tanzillo Design Automation Consulting */
>/* Programming & Customization for AutoCAD & Compatibles */
>/* ----------------------------------------------------- */
>/*
[email protected] */
>/* http://ourworld.compuserve.com/homepages/tonyt */
>/*********************************************************/