![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Help with VBA
There's a great VBA from pptools.com that I've successfully used for a few
years now (below). Essentially, it'll help toggle text on and off with a mouse click, and I usually use it for multiple buttons on a single slide (e.g. for a game). But recently I can't toggle. The first click over the button will show/hide text, but the second click takes me to the next slide. And after playing around with keyboard stuff, the code will only work properly for me if I press tab at the same time I do a left mouse click over the action button (i.e. it will toggle text correctly rather than go to the next slide). I never had to press tab before (nor do I want to during presentations). Can someone help me troubleshoot? I have PowerPoint 2007 running on Vista. Thanks. ***************************** Sub Peekaboo(oSh As Shape) ' Hides/makes visible the shape's text With oSh.TextFrame.TextRange ' If it has text ... If Len(.Text) > 0 Then ' Store the text in a tag so we can retrieve it later oSh.Tags.Add "PeekabooText", .Text ' Now blank the text .Text = "" Else .Text = oSh.Tags("PeekabooText") End If End With End Sub Sub ResetPeekaboos() ' Resets the shapes with peekaboo text to make the text invisible Dim oSh As Shape Dim oSl As Slide For Each oSl In ActivePresentation.Slides For Each oSh In oSl.Shapes If Len(oSh.Tags("PeekabooText")) > 0 Then oSh.TextFrame.TextRange.Text = "" End If Next ' oSh Next ' oSl End Sub Sub UnhidePeekaboos() ' Resets the shapes with peekaboo text to make the text visible Dim oSh As Shape Dim oSl As Slide For Each oSl In ActivePresentation.Slides For Each oSh In oSl.Shapes If Len(oSh.Tags("PeekabooText")) > 0 Then oSh.TextFrame.TextRange.Text = oSh.Tags("PeekabooText") End If Next ' oSh Next ' oSl End Sub Sub HidePeekaboos() ' Resets the shapes with peekaboo text to make the text invisible ' You must have activated the text as peekaboo one time for this to work Dim oSh As Shape Dim oSl As Slide For Each oSl In ActivePresentation.Slides For Each oSh In oSl.Shapes If Len(oSh.Tags("PeekabooText")) > 0 Then oSh.TextFrame.TextRange.Text = "" End If Next ' oSh Next ' oSl End Sub |
|
|||
|
Re: Help with VBA
Great ... thanks for posting here as well as the email to me. For starters, let's narrow down what might have caused this. Did it start happening when you switched to PPT 2007 and/or Vista, or did it work there for a time? If the latter, what else might have changed on the system or in PowerPoint? In article <7CAFC261-3522-4C7A-B812-2133E78299CC@microsoft.com>, EBWired wrote: > There's a great VBA from pptools.com that I've successfully used for a few > years now (below). Essentially, it'll help toggle text on and off with a > mouse click, and I usually use it for multiple buttons on a single slide > (e.g. for a game). But recently I can't toggle. The first click over the > button will show/hide text, but the second click takes me to the next slide. > And after playing around with keyboard stuff, the code will only work > properly for me if I press tab at the same time I do a left mouse click over > the action button (i.e. it will toggle text correctly rather than go to the > next slide). I never had to press tab before (nor do I want to during > presentations). > > Can someone help me troubleshoot? I have PowerPoint 2007 running on Vista. > Thanks. > > ***************************** > Sub Peekaboo(oSh As Shape) > ' Hides/makes visible the shape's text > > With oSh.TextFrame.TextRange > ' If it has text ... > If Len(.Text) > 0 Then > ' Store the text in a tag so we can retrieve it later > oSh.Tags.Add "PeekabooText", .Text > ' Now blank the text > .Text = "" > Else > .Text = oSh.Tags("PeekabooText") > End If > End With > > End Sub > > Sub ResetPeekaboos() > ' Resets the shapes with peekaboo text to make the text invisible > > Dim oSh As Shape > Dim oSl As Slide > > For Each oSl In ActivePresentation.Slides > For Each oSh In oSl.Shapes > If Len(oSh.Tags("PeekabooText")) > 0 Then > oSh.TextFrame.TextRange.Text = "" > End If > Next ' oSh > Next ' oSl > > End Sub > > Sub UnhidePeekaboos() > ' Resets the shapes with peekaboo text to make the text visible > > Dim oSh As Shape > Dim oSl As Slide > > For Each oSl In ActivePresentation.Slides > For Each oSh In oSl.Shapes > If Len(oSh.Tags("PeekabooText")) > 0 Then > oSh.TextFrame.TextRange.Text = oSh.Tags("PeekabooText") > End If > Next ' oSh > Next ' oSl > > End Sub > > Sub HidePeekaboos() > ' Resets the shapes with peekaboo text to make the text invisible > ' You must have activated the text as peekaboo one time for this to work > > Dim oSh As Shape > Dim oSl As Slide > > For Each oSl In ActivePresentation.Slides > For Each oSh In oSl.Shapes > If Len(oSh.Tags("PeekabooText")) > 0 Then > oSh.TextFrame.TextRange.Text = "" > End If > Next ' oSh > Next ' oSl > > End Sub > ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================ Live and in personable in the Help Center at PowerPoint Live Sept 21-24, San Diego CA, USA www.pptlive.com |
|
|||
|
Re: Help with VBA
Hi Steve,
Yes, everything was working with my system and I'm not sure what changed. My macros are enabled, and when I do a dummy test on a new presentation, the same glitch occurs. I have a feeling it's probably with my settings, but I just don't know why or where to start. Does that tab+left mouse click give you a clue? On two sidenotes, I didn't realize I would reach the same person with this problem, so that's great. Second, I see that you'll be in San Diego where I live, but it's too bad that I'll be out of town this weekend. Maybe I can check out what pptlive is all about next Tue or Wed! "Steve Rindsberg" wrote: > > Great ... thanks for posting here as well as the email to me. > > For starters, let's narrow down what might have caused this. > Did it start happening when you switched to PPT 2007 and/or Vista, or did it > work there for a time? If the latter, what else might have changed on the > system or in PowerPoint? > |
|
|||
|
Re: Help with VBA
Tellyawhat ... create a small pressie that does this and email it to me at steve
atsign pptools dot com But first, check the slide setup and make sure it's set to kiosk mode. PPTLive registration starts Sunday; the event itself starts Monday and runs through Weds. Since you wouldn't need a hotel room, it might well be worth looking into. Lots of good presenters there, lots of good info to be shared. And once you're past the bouncer at the door (big rabbit-looking fella named Harvey) look me up in the help center. <g> In article <6E72E903-FCC3-47F9-A45F-F12D01DDFE7B@microsoft.com>, EBWired wrote: > Hi Steve, > > Yes, everything was working with my system and I'm not sure what changed. > My macros are enabled, and when I do a dummy test on a new presentation, the > same glitch occurs. I have a feeling it's probably with my settings, but I > just don't know why or where to start. Does that tab+left mouse click give > you a clue? > > On two sidenotes, I didn't realize I would reach the same person with this > problem, so that's great. Second, I see that you'll be in San Diego where I > live, but it's too bad that I'll be out of town this weekend. Maybe I can > check out what pptlive is all about next Tue or Wed! > > "Steve Rindsberg" wrote: > > > > > Great ... thanks for posting here as well as the email to me. > > > > For starters, let's narrow down what might have caused this. > > Did it start happening when you switched to PPT 2007 and/or Vista, or did it > > work there for a time? If the latter, what else might have changed on the > > system or in PowerPoint? > > > ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================ Live and in personable in the Help Center at PowerPoint Live Sept 21-24, San Diego CA, USA www.pptlive.com |
|
|||
|
Re: Help with VBA
This sounds like a long shot but the ALT key enables ENTER to activate the
action button. Could you have set your mouse click up to emulate ENTER? -- Amazing PPT Hints, Tips and Tutorials http://www.pptalchemy.co.uk/powerpoi...tutorials.html _______________________________ We''re at PPTLive - see you there? www.pptlive.com "EBWired" wrote: > Hi Steve, > > Yes, everything was working with my system and I'm not sure what changed. > My macros are enabled, and when I do a dummy test on a new presentation, the > same glitch occurs. I have a feeling it's probably with my settings, but I > just don't know why or where to start. Does that tab+left mouse click give > you a clue? > > On two sidenotes, I didn't realize I would reach the same person with this > problem, so that's great. Second, I see that you'll be in San Diego where I > live, but it's too bad that I'll be out of town this weekend. Maybe I can > check out what pptlive is all about next Tue or Wed! > > > > "Steve Rindsberg" wrote: > > > > > Great ... thanks for posting here as well as the email to me. > > > > For starters, let's narrow down what might have caused this. > > Did it start happening when you switched to PPT 2007 and/or Vista, or did it > > work there for a time? If the latter, what else might have changed on the > > system or in PowerPoint? > > > > |
|
|||
|
Re: Help with VBA
Hi John,
Thanks for explaining what the tab key does (it's not the Alt from what I see). I experimented and yes, if I tab to each action button and press Enter, then the toggle VBA works. I'll also look into the mouse settings some more since I had a hard time figuring it out right away. I wonder if MS changed something through its updates so that the VBA doesn't work with the mouse anymore? It's frustratingly weird. And I would've responded earlier. I didn't know you replied to my post. Thanks again! "John Wilson" wrote: > This sounds like a long shot but the ALT key enables ENTER to activate the > action button. Could you have set your mouse click up to emulate ENTER? > -- > Amazing PPT Hints, Tips and Tutorials > > http://www.pptalchemy.co.uk/powerpoi...tutorials.html > _______________________________ > > We''re at PPTLive - see you there? > www.pptlive.com > > > "EBWired" wrote: > > > Hi Steve, > > > > Yes, everything was working with my system and I'm not sure what changed. > > My macros are enabled, and when I do a dummy test on a new presentation, the > > same glitch occurs. I have a feeling it's probably with my settings, but I > > just don't know why or where to start. Does that tab+left mouse click give > > you a clue? > > > > On two sidenotes, I didn't realize I would reach the same person with this > > problem, so that's great. Second, I see that you'll be in San Diego where I > > live, but it's too bad that I'll be out of town this weekend. Maybe I can > > check out what pptlive is all about next Tue or Wed! > > > > > > > > "Steve Rindsberg" wrote: > > > > > > > > Great ... thanks for posting here as well as the email to me. > > > > > > For starters, let's narrow down what might have caused this. > > > Did it start happening when you switched to PPT 2007 and/or Vista, or did it > > > work there for a time? If the latter, what else might have changed on the > > > system or in PowerPoint? > > > > > > > |
|
|||
|
Re: Help with VBA
Can we name the new bug after you, Eugene? ;-)
Seems to be an oddity in PPT 2007; after triggering one action setting that fires a macro, PPT2007 acts as though all the "animation" on the slide is done ... you'll notice that none of the shapes with action settings are active any longer after firing the macro once ... no pointing hand pointer, etc. Once I noticed that, I figured that "reloading" the slide, same as we have to do to get animations to replay, might work. And begorrah. It does. One line of code fixes it, see below: Sub Peekaboo(oSh As Shape) ' Hides/makes visible the shape's text With oSh.TextFrame.TextRange ' If it has text ... If Len(.Text) > 0 Then ' Store the text in a tag so we can retrieve it later oSh.Tags.Add "PeekabooText", .Text ' Now blank the text .Text = "" Else .Text = oSh.Tags("PeekabooText") End If End With ' ADD THIS LINE SlideShowWindows(1).View.GotoSlide (oSh.Parent.SlideIndex) End Sub In article <7CAFC261-3522-4C7A-B812-2133E78299CC@microsoft.com>, EBWired wrote: > There's a great VBA from pptools.com that I've successfully used for a few > years now (below). Essentially, it'll help toggle text on and off with a > mouse click, and I usually use it for multiple buttons on a single slide > (e.g. for a game). But recently I can't toggle. The first click over the > button will show/hide text, but the second click takes me to the next slide. > And after playing around with keyboard stuff, the code will only work > properly for me if I press tab at the same time I do a left mouse click over > the action button (i.e. it will toggle text correctly rather than go to the > next slide). I never had to press tab before (nor do I want to during > presentations). > > Can someone help me troubleshoot? I have PowerPoint 2007 running on Vista. > Thanks. > > ***************************** > Sub Peekaboo(oSh As Shape) > ' Hides/makes visible the shape's text > > With oSh.TextFrame.TextRange > ' If it has text ... > If Len(.Text) > 0 Then > ' Store the text in a tag so we can retrieve it later > oSh.Tags.Add "PeekabooText", .Text > ' Now blank the text > .Text = "" > Else > .Text = oSh.Tags("PeekabooText") > End If > End With > > End Sub > > Sub ResetPeekaboos() > ' Resets the shapes with peekaboo text to make the text invisible > > Dim oSh As Shape > Dim oSl As Slide > > For Each oSl In ActivePresentation.Slides > For Each oSh In oSl.Shapes > If Len(oSh.Tags("PeekabooText")) > 0 Then > oSh.TextFrame.TextRange.Text = "" > End If > Next ' oSh > Next ' oSl > > End Sub > > Sub UnhidePeekaboos() > ' Resets the shapes with peekaboo text to make the text visible > > Dim oSh As Shape > Dim oSl As Slide > > For Each oSl In ActivePresentation.Slides > For Each oSh In oSl.Shapes > If Len(oSh.Tags("PeekabooText")) > 0 Then > oSh.TextFrame.TextRange.Text = oSh.Tags("PeekabooText") > End If > Next ' oSh > Next ' oSl > > End Sub > > Sub HidePeekaboos() > ' Resets the shapes with peekaboo text to make the text invisible > ' You must have activated the text as peekaboo one time for this to work > > Dim oSh As Shape > Dim oSl As Slide > > For Each oSl In ActivePresentation.Slides > For Each oSh In oSl.Shapes > If Len(oSh.Tags("PeekabooText")) > 0 Then > oSh.TextFrame.TextRange.Text = "" > End If > Next ' oSh > Next ' oSl > > End Sub > ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================ |
|
|||
|
Re: Help with VBA
At first try, the code worked. And so the universe is back to normal again.
Let's just hope that once I fix the old PPT files that they'll be fine. Steve, you and John rock, and so thank you very much for help with this. "Steve Rindsberg" wrote: > Can we name the new bug after you, Eugene? ;-) > > Seems to be an oddity in PPT 2007; after triggering one action setting that > fires a macro, PPT2007 acts as though all the "animation" on the slide is done > ... you'll notice that none of the shapes with action settings are active any > longer after firing the macro once ... no pointing hand pointer, etc. > > Once I noticed that, I figured that "reloading" the slide, same as we have to do > to get animations to replay, might work. And begorrah. It does. One line of > code fixes it, see below: > > Sub Peekaboo(oSh As Shape) > ' Hides/makes visible the shape's text > > With oSh.TextFrame.TextRange > ' If it has text ... > If Len(.Text) > 0 Then > ' Store the text in a tag so we can retrieve it later > oSh.Tags.Add "PeekabooText", .Text > ' Now blank the text > .Text = "" > Else > .Text = oSh.Tags("PeekabooText") > End If > End With > > ' ADD THIS LINE > SlideShowWindows(1).View.GotoSlide (oSh.Parent.SlideIndex) > > > End Sub > > > In article <7CAFC261-3522-4C7A-B812-2133E78299CC@microsoft.com>, EBWired wrote: > > There's a great VBA from pptools.com that I've successfully used for a few > > years now (below). Essentially, it'll help toggle text on and off with a > > mouse click, and I usually use it for multiple buttons on a single slide > > (e.g. for a game). But recently I can't toggle. The first click over the > > button will show/hide text, but the second click takes me to the next slide. > > And after playing around with keyboard stuff, the code will only work > > properly for me if I press tab at the same time I do a left mouse click over > > the action button (i.e. it will toggle text correctly rather than go to the > > next slide). I never had to press tab before (nor do I want to during > > presentations). > > > > Can someone help me troubleshoot? I have PowerPoint 2007 running on Vista. > > Thanks. > > > > ***************************** > > Sub Peekaboo(oSh As Shape) > > ' Hides/makes visible the shape's text > > > > With oSh.TextFrame.TextRange > > ' If it has text ... > > If Len(.Text) > 0 Then > > ' Store the text in a tag so we can retrieve it later > > oSh.Tags.Add "PeekabooText", .Text > > ' Now blank the text > > .Text = "" > > Else > > .Text = oSh.Tags("PeekabooText") > > End If > > End With > > > > End Sub > > > > Sub ResetPeekaboos() > > ' Resets the shapes with peekaboo text to make the text invisible > > > > Dim oSh As Shape > > Dim oSl As Slide > > > > For Each oSl In ActivePresentation.Slides > > For Each oSh In oSl.Shapes > > If Len(oSh.Tags("PeekabooText")) > 0 Then > > oSh.TextFrame.TextRange.Text = "" > > End If > > Next ' oSh > > Next ' oSl > > > > End Sub > > > > Sub UnhidePeekaboos() > > ' Resets the shapes with peekaboo text to make the text visible > > > > Dim oSh As Shape > > Dim oSl As Slide > > > > For Each oSl In ActivePresentation.Slides > > For Each oSh In oSl.Shapes > > If Len(oSh.Tags("PeekabooText")) > 0 Then > > oSh.TextFrame.TextRange.Text = oSh.Tags("PeekabooText") > > End If > > Next ' oSh > > Next ' oSl > > > > End Sub > > > > Sub HidePeekaboos() > > ' Resets the shapes with peekaboo text to make the text invisible > > ' You must have activated the text as peekaboo one time for this to work > > > > Dim oSh As Shape > > Dim oSl As Slide > > > > For Each oSl In ActivePresentation.Slides > > For Each oSh In oSl.Shapes > > If Len(oSh.Tags("PeekabooText")) > 0 Then > > oSh.TextFrame.TextRange.Text = "" > > End If > > Next ' oSh > > Next ' oSl > > > > End Sub > > > > ----------------------------------------- > Steve Rindsberg, PPT MVP > PPT FAQ: www.pptfaq.com > PPTools: www.pptools.com > ================================================ > > > |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|