Skip to main content

Simple Node Code

I’ve seen plenty of solutions for building slideshow tutorials that use a callout with a speech tag pointing to the item of interest on the slide. Most of these approaches involve creating large numbers of slides with complex navigation — a real tangle to manage.

The simplest method I’ve found is to use an array, an If statement, and the .Nodes.SetPosition method. I won’t include the full code here — that’s something I’ll save for a book I plan to publish later — but the example below should give you the idea.

First, add a callout shape to your slide. Then right-click the callout and select Edit Points. Move the tip of the callout tag (the point with the yellow handle). This converts the callout into an object that you can control more flexibly with code.


Now on the top ribbon choose the developer tab and then select the macro icon. If you can't see the developer tab in the ribbon, a quick Google search will bring up a bunch of tutorials on what to do to make it available and how to turn on macro capability.


You'll then bring up a macro window where you can create a new macro. I've created one called Call_Out.


Hit Create and a new larger macro editing window will open for you. This is where the magic happens. You should now be looking at a generated scrip container something like this.


This is where you will add some code. But before you do it helps to start naming individual objects so that you can use the code to tell them to do things. Back in the main screen of PowerPoint choose the home tab.


At the far right of the home tab menu, you will see the select dropdown. Choose select and then selection pane. This will open a panel that shows each object on your slide and its position in relation to the other objects, very much like a layering menu in other multimedia software. Here you will be able to make objects visible or invisible, rename them or the group they may be in.


So here you can see the callout shape that I created and will manipulate with code. I've called mine Call1 you can name yours anything you want. Next, add the script bellow back in the macro script.


So to quickly explain this script..
The Sub is the subroutine and I called it Call_Out in the create macro window. Dim is how you declare variables and other objects. Set is declaring that when the program sees the variable name that it means the thing it equals. This could be a "string" a number or a repeated command. The work here is being done in the .Node.Setposition 7, 425,179 . What this is doing is grabbing the 7th point and translating it or repositioning it to a new position using the last two values. These are the x and y coordinates ( play with these to find the position you need ). It is with this code I can get the call out to point at any item on the screen of the phone. All I do is change the last two sets of numbers to place the point where I need it. To connect this action to a button I just need to choose the button I want to run the macro then under insert action, choose the macro I want to run on click. By the way you'll notice that the script is repeated for the second slide in my example. You don't need to add the second lot of code. This just worked for the project I was creating at the time.


Try this out yourself there is no end of uses for it.



Comments

Popular posts from this blog

Button States From A Table

I was recently asked to create a button with different visual states — normal , hover , and pressed . My first thought was to use a standard command button from the Developer tab. However, those buttons are rather bland and have that clunky 1980s PC look. I then recalled a couple of techniques I’ve used before to update slide content dynamically — either pulling data from a table or from another shape. Both are flexible approaches. The method I’ll show here uses a table — it’s simple, and with a bit of creativity, you’ll quickly see how this can be extended to build much more interesting interactions. The Process: On any slide create a shape I've put mine on the first slide hence in the script it reads ActivePresentation.Slides(1) when I refer to the path of the shape. You can change the number if your shape is on a different slide. Once you create your shape in the Selection Pane rename your object to myButton or something else that you can remember easily later. ...

Why PowerPoint?

To begin with, I’m not aware of any other software that can create fully standalone multimedia interfaces — self-contained, requiring no external host — that are as widely accessible to PC users. While I know of tools like Apache or LibreOffice, they are neither popular nor readily supported in the organisation I work for. PowerPoint, on the other hand, is installed on every machine and regarded as an enterprise-grade solution — stable, secure, and universally accepted. It’s a shame that the world has largely moved away from SWF and ActionScript. I really enjoyed developing with AS2 and AS3 — Adobe Flash was one of the best animation tools around. I’ve explored Adobe Animate, which remains a good animation platform, but its HTML5 output isn’t consistently reliable across all browsers. In fact, a lot can go wrong with HTML5, especially when you want to create standalone applications — the limitations quickly become apparent. For me, PowerPoint still ticks all the boxes. It offers an exc...

4 Awesome PowerPoint Drag and Drop Tutorials

I have done drag and drop differently in the past but this will now be my new go to script for all my projects in the future. Check it out for yourself. '//////////////////////////////////////////////////////////////////////This is the code Option Explicit Private Const SM_SCREENX = 1 Private Const SM_SCREENY = 0 Private Const msgCancel = "." Private Const msgNoXlInstance = "." Private Const sigProc = "Drag & Drop" Private Const VK_SHIFT = &H10 Private Const VK_CTRL = &H11 Private Const VK_ALT = &H12 Public Type PointAPI  X As Long  Y As Long End Type   Public Type RECT  lLeft As Long  lTop As Long  lRight As Long  lBottom As Long End Type Public Type SquareEnd  X As Long  Y As Long End Type #If VBA7 Then  Public Declare PtrSafe Function GetKeyState Lib "user32" (ByVal nVirtKey As LongPtr) As Integer  Public Declare PtrSafe Function ...