A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

VB UserForms



 
 
Thread Tools Display Modes
  #1  
Old July 9th, 2008, 01:01 AM posted to microsoft.public.powerpoint
GLHEC-BLS[_2_]
external usenet poster
 
Posts: 21
Default VB UserForms

I am just learning how to create userforms using VB code in PowerPoint. In
all the resources I have found on the web I have not been able to find one
that shows how to get what I create on a userform in the VB editor to show up
in a presentation. The closest example I have is this but it still does not
show during show mode in powerpoint. It does work if I hit run sub/userform
in the VB editor though. Any suggestions?? Also any insightful links for VB
beginners specific to using VB in Powerpoint is greatly appreciated. Thanks.

Private Sub CommandButton1_Click()
Image2.Picture = Image1.Picture
End Sub
Sub ShowForm()
UserForm2.Show
End Sub

  #2  
Old July 9th, 2008, 03:33 AM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default VB UserForms

In article , Glhec-Bls
wrote:
I am just learning how to create userforms using VB code in PowerPoint. In
all the resources I have found on the web I have not been able to find one
that shows how to get what I create on a userform in the VB editor to show up
in a presentation. The closest example I have is this but it still does not
show during show mode in powerpoint. It does work if I hit run sub/userform
in the VB editor though. Any suggestions?? Also any insightful links for VB
beginners specific to using VB in Powerpoint is greatly appreciated. Thanks.

Private Sub CommandButton1_Click()
Image2.Picture = Image1.Picture
End Sub
Sub ShowForm()
UserForm2.Show
End Sub


Assuming you have a form named UserForm2, your Sub ShowForm should do it, but
something has to force IT to run.

Private Sub CommandButton1_Click()
UserForm2.Show
End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


  #3  
Old July 9th, 2008, 07:34 PM posted to microsoft.public.powerpoint
Austin Myers
external usenet poster
 
Posts: 1,631
Default VB UserForms

Hmmm, I see no load statement...



Austin Myers
Microsoft PowerPoint MVP Team

Creator of PFCPro, PFCMedia and PFCExpress
http://www.playsforcertain.com


"Steve Rindsberg" wrote in message
...
In article , Glhec-Bls
wrote:
I am just learning how to create userforms using VB code in PowerPoint.
In
all the resources I have found on the web I have not been able to find
one
that shows how to get what I create on a userform in the VB editor to
show up
in a presentation. The closest example I have is this but it still does
not
show during show mode in powerpoint. It does work if I hit run
sub/userform
in the VB editor though. Any suggestions?? Also any insightful links for
VB
beginners specific to using VB in Powerpoint is greatly appreciated.
Thanks.

Private Sub CommandButton1_Click()
Image2.Picture = Image1.Picture
End Sub
Sub ShowForm()
UserForm2.Show
End Sub


Assuming you have a form named UserForm2, your Sub ShowForm should do it,
but
something has to force IT to run.

Private Sub CommandButton1_Click()
UserForm2.Show
End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================




  #4  
Old July 9th, 2008, 08:40 PM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default VB UserForms

In article , Austin Myers wrote:
Hmmm, I see no load statement...


Not necessary. Accessing anything in the form implicitly loads it.
But the code to Show it has to run.


Austin Myers
Microsoft PowerPoint MVP Team

Creator of PFCPro, PFCMedia and PFCExpress
http://www.playsforcertain.com

"Steve Rindsberg" wrote in message
...
In article , Glhec-Bls
wrote:
I am just learning how to create userforms using VB code in PowerPoint.
In
all the resources I have found on the web I have not been able to find
one
that shows how to get what I create on a userform in the VB editor to
show up
in a presentation. The closest example I have is this but it still does
not
show during show mode in powerpoint. It does work if I hit run
sub/userform
in the VB editor though. Any suggestions?? Also any insightful links for
VB
beginners specific to using VB in Powerpoint is greatly appreciated.
Thanks.

Private Sub CommandButton1_Click()
Image2.Picture = Image1.Picture
End Sub
Sub ShowForm()
UserForm2.Show
End Sub


Assuming you have a form named UserForm2, your Sub ShowForm should do it,
but
something has to force IT to run.

Private Sub CommandButton1_Click()
UserForm2.Show
End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================




-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


  #5  
Old July 9th, 2008, 10:11 PM posted to microsoft.public.powerpoint
GLHEC-BLS[_2_]
external usenet poster
 
Posts: 21
Default VB UserForms

Like I said, I am new to VB, as in I have been using the help function for
two days to figure out what I know. So by load statement you mean......?

I understand that what Steve wrote would create a command button that when
clicked would show the form, but how would I write it so the form would show
right away when you open PPT in show mode, to make it always visible. Like a
command that makes userform2 open when PPT show mode is initialized....er
something.

Thanks for the help.

"Steve Rindsberg" wrote:

In article , Austin Myers wrote:
Hmmm, I see no load statement...


Not necessary. Accessing anything in the form implicitly loads it.
But the code to Show it has to run.


Austin Myers
Microsoft PowerPoint MVP Team

Creator of PFCPro, PFCMedia and PFCExpress
http://www.playsforcertain.com

"Steve Rindsberg" wrote in message
...
In article , Glhec-Bls
wrote:
I am just learning how to create userforms using VB code in PowerPoint.
In
all the resources I have found on the web I have not been able to find
one
that shows how to get what I create on a userform in the VB editor to
show up
in a presentation. The closest example I have is this but it still does
not
show during show mode in powerpoint. It does work if I hit run
sub/userform
in the VB editor though. Any suggestions?? Also any insightful links for
VB
beginners specific to using VB in Powerpoint is greatly appreciated.
Thanks.

Private Sub CommandButton1_Click()
Image2.Picture = Image1.Picture
End Sub
Sub ShowForm()
UserForm2.Show
End Sub

Assuming you have a form named UserForm2, your Sub ShowForm should do it,
but
something has to force IT to run.

Private Sub CommandButton1_Click()
UserForm2.Show
End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================




-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



  #6  
Old July 9th, 2008, 11:06 PM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default VB UserForms

In article , Glhec-Bls wrote:
Like I said, I am new to VB, as in I have been using the help function for
two days to figure out what I know. So by load statement you mean......?


If you want, you can load forms into memory without showing them using the Load
statement. For big, complex forms on old slow computers, this can save time; when
you Show the form, it's already in memory.

But Show by itself both loads and shows the form.

I understand that what Steve wrote would create a command button that when
clicked would show the form, but how would I write it so the form would show
right away when you open PPT in show mode, to make it always visible. Like a
command that makes userform2 open when PPT show mode is initialized....er
something.


You can either create an event handler and add code so that it only does something
when your particular show is loaded or, much much simpler, you could put an action
button or other link on the first slide. User clicks that, it runs code to
display your form, move to the next slide and whatever else you need done at slide
show initialization time.



Thanks for the help.

"Steve Rindsberg" wrote:

In article , Austin Myers wrote:
Hmmm, I see no load statement...


Not necessary. Accessing anything in the form implicitly loads it.
But the code to Show it has to run.


Austin Myers
Microsoft PowerPoint MVP Team

Creator of PFCPro, PFCMedia and PFCExpress
http://www.playsforcertain.com

"Steve Rindsberg" wrote in message
...
In article , Glhec-Bls
wrote:
I am just learning how to create userforms using VB code in PowerPoint.
In
all the resources I have found on the web I have not been able to find
one
that shows how to get what I create on a userform in the VB editor to
show up
in a presentation. The closest example I have is this but it still does
not
show during show mode in powerpoint. It does work if I hit run
sub/userform
in the VB editor though. Any suggestions?? Also any insightful links for
VB
beginners specific to using VB in Powerpoint is greatly appreciated.
Thanks.

Private Sub CommandButton1_Click()
Image2.Picture = Image1.Picture
End Sub
Sub ShowForm()
UserForm2.Show
End Sub

Assuming you have a form named UserForm2, your Sub ShowForm should do it,
but
something has to force IT to run.

Private Sub CommandButton1_Click()
UserForm2.Show
End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================




-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================





-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.