Re: Using a previous procedure event by Steve
Steve
Sun Jan 11 16:24:58 CST 2004
G'day "Jason Logue" <anonymous@discussions.microsoft.com>,
is this still outstanding? Sorry for the delay - silly season, moved
house & ISPs etc.
"Jason Logue" <anonymous@discussions.microsoft.com> was spinning this
yarn:
>I hate to be a bother about this, but should the "Public
>buttonclick as long, sub command_button1_click code" go on
>the userform that contains the textboxes (the place where
>the text is inserted), or should it go in the code under
>the final button they click. Right now it still inserts
>the bookmark in each textbox without using any of my If
>
>I have the following code under one Commandbutton in the
>final window (keep in mind, your code farther below is in
>the original userform with the textboxes):
>
>Set source = Documents.Open("C:\Documents and
>Settings\Logue\My Documents\Allied
>Title\exceptions\exceptions.doc")
>
>If 1 Then
>
> Userform3.TextBox8.Text = source.Bookmarks
>("Chapter1_1").Range
>
>
>
> End If
>
> If 2 Then
>
>
>
> Userform3.TextBox4.Text = source.Bookmarks
>("Chapter1_1").Range
>
>End If...and so on...
>
>And as of now, it bumps right to the userform3.textbox
>(whatevernumber).text = source...and so on, and inserts
>the text in all the textboxes on that page
>indiscriminately.
>
>Thanks,
>Jason
>>-----Original Message-----
>>G'day "Jason Logue" <anonymous@discussions.microsoft.com>,
>>
>>Public ButtonClick as Long
>>
>>
>>sub Command_Button1_Click
>>
>>ButtonClick=1
>>'do other stuff
>>end sub
>>
>>sub Command_Button2_Click
>>
>>ButtonClick=2
>>'do other stuff
>>end sub
>>
>> "Jason Logue" <anonymous@discussions.microsoft.com> was
>spinning this
>>yarn:
>>
>>>Okay, I understand that but how do I do it for this
>>>situation and where? I am a newbie, so I am still
>>>learning.
>>>
>>>
>>>TIA,
>>>Jason
>>>>-----Original Message-----
>>>>G'day "Jason Logue"
><anonymous@discussions.microsoft.com>,
>>>>
>>>>set variables of appropriate scope to the destination.
>>>>
>>>>
>>>> "Jason Logue" <anonymous@discussions.microsoft.com>
>was
>>>spinning this
>>>>yarn:
>>>>
>>>>>How do I call or dim an event from a previous
>procedure
>>>in
>>>>>a userform? I am using userforms, and the user will
>>>click
>>>>>on a button to open another window, and in that window
>>>>>they will click another button, and finally, in the
>last
>>>>>window they will click another button that initiates
>>>code
>>>>>that goes out finds bookmarked text and plops it into
>a
>>>>>textbox adjacent to the first button in the first
>>>>>userform. I would like the code under the final
>>>>>commanbutton to determine which original button was
>>>>>clicked and insert the text appropriately. Here is
>what
>>>I
>>>>>have so far:
>>>>>
>>>>>Sub CommandButton1_Click()
>>>>>
>>>>>
>>>>>
>>>>>Set source = Documents.Open("C:\Documents and
>>>>>Settings\Logue\My Documents\Allied
>>>>>Title\exceptions\exceptions.doc")
>>>>>
>>>>>(this is where the bookmarked text is located)
>>>>>
>>>>>
>>>>>
>>>>>If Userform3.ExceptionsButton1_Click Then
>>>>>
>>>>>(my attempt to tell say if the button was clicked in
>>>>>userform3, which is the starting place of this whole
>>>>>event, then the following code will take place)
>>>>>
>>>>>
>>>>> Userform3.TextBox8.Text = source.Bookmarks
>>>>>("Chapter1_1").Range
>>>>>
>>>>> End If
>>>>>
>>>>>(and if it was clicked, then it moves on to this next
>>>bit
>>>>>of code and so on)
>>>>>
>>>>> If Userform3.ExceptionsButton3_Click Then
>>>>>
>>>>> Userform3.TextBox4.Text =
>>>source.Bookmarks
>>>>>("Chapter1_1").Range
>>>>>
>>>>> End If
>>>>>
>>>>>and it goes on...
>>>>>
>>>>>Right now it's either doing nothing or inserting code
>in
>>>>>every textbox on the original userform. Any
>suggestions
>>>>>are welcome.
>>>>>
>>>>>TIA,
>>>>>Jason
>>>>
>>>>Steve Hudson
>>>>
>>>>Word Heretic, Sydney, Australia
>>>>Tricky stuff with Word or words for you.
>>>>wordheretic.com
>>>>
>>>>If my answers r 2 terse, ask again or hassle an MVP,
>>>>at least they get recognition for it then.
>>>>Lengthy replies offlist require payment.
>>>>.
>>>>
>>
>>Steve Hudson
>>
>>Word Heretic, Sydney, Australia
>>Tricky stuff with Word or words for you.
>>wordheretic.com
>>
>>If my answers r 2 terse, ask again or hassle an MVP,
>>at least they get recognition for it then.
>>Lengthy replies offlist require payment.
>>.
>>
Steve Hudson
Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com
If answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.