borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (MsAccess Reports in VB)Next Topic (vba to vb possibly?) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Running a macro at startup in PowerPoint
Poster Message
fabulous
Level: VB Guru


Registered: 03-08-2002
Posts: 439

icon Running a macro at startup in PowerPoint

There is a macro that I wrote in PowerPoint to make the presentation run on Monitor 2 Default (PowerPoint 2000). This is for a bunch of pple who only use a computer once a week so they cannot remember the sequence of doing it manually. What I wanted to do was to run this macro which only sends keystrokes via the send key function:

Public Sub Setup()
  'If this code works, it was written by Fabulous Fadz
  'If not then I don't know who wrote it
  SendKeys "%ds%om~", True
End Sub


This works fine except that the quickest way for them to run it is to use the Alt+F8 key combination. They cannot remember that most of the time so I have a sticky label on the monitor to remind them.

What I wanted to do was to put a button on the toolbar at startup so that they could run it when they want, but I gave up the access object model because of lack of time. I then tried to do it if the user opened the presentation but I cannot get events on the presentation and I cannot make my code run when PowerPoint is opened.

I am giving away a free bucket of bits to anyone who can tell me how to do it either way, the toolbar or at startup. Because now I have to be there when they want to run ppnt and they are surprised to see they slides on the screen instead of the overhead. Thanx...

____________________________
My boss is a Jewish Carpenter (Jesus Christ)


Brain Bench Certified VB.NET Developer

16-03-2003 at 01:12 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 910
icon Re: Running a macro at startup in PowerPoint

Well, pardon my dumbness
I don't understand if you want the ability to run it for each PowerPoint session (regardless on which .ppt file you open), or either for a certain .ppt file.

In the first case, a small thought: why not searching for a Windows key manager? There are some on which you can set a special key combination to execute some files (e.g. Powerpnt.exe)?

In the second case, why not put the macro directly into the .ppt file?

Case Else: I don't understand exactly what the question is, so excuse me and please explain me deeper.

I searched the newsgroups for PowerPoint, and the best I found is the following:
http://search.communities.microsoft.com/newsgroups/previewFrame.asp?ICP=office_all&sLCID=US&sgroupURL=microsoft.public.powerpoint&sMessageID=%253COjojAxL0CHA.2216@TK2MSFTNGP09%253E

Hope it helps



____________________________
Real Programmer can count up to 1024 on his fingers

18-03-2003 at 10:04 AM
View Profile Send Email to User Show All Posts | Quote Reply
fabulous
Level: VB Guru


Registered: 03-08-2002
Posts: 439
icon Re: Running a macro at startup in PowerPoint

This issue was solved and it turned out that I did not need the macro after all. I installed the proper drivers for the device we connected to the secondary monitor an ADS XGA Converter. It converts VGA to video and passes a VGA signal allowing us to send the signal via video signal to the projectors and connecting to a second VDU so that we can have a preview of what is going on. After doing this, as long as the projectors are connected and on before the computer is booted, Powerpoint has no trouble detecting the second monitor and actually defaults to it.

Just thought I would update everybody in case anyone faces the same problem in future. I would still like to know how to run a macro at startup for Powerpoint however, and would appreciate any info on this or where to get an up-to-date object model. Thanx...

____________________________
My boss is a Jewish Carpenter (Jesus Christ)


Brain Bench Certified VB.NET Developer

08-06-2003 at 01:13 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488
icon Re: Running a macro at startup in PowerPoint

Auto_Open sub should do this but I think in Powerpoint you need to place this sub in a powerpoint add-in (apparently, powerpoint doesnt have the same support for events as other Office apps - i tried an Auto_Open and a Presentation_Open sub in a presentation an neither seemed to work)

HOWEVER, check this out...

http://www.mvps.org/skp/autoevents.htm

There's a lot of other good stuff on that site too so checkout the downloads page...as for changing monitors...
but certainly if you're going to have a toolbar anyway than you could put the toolbar, monitor change, andany other startup code in an add-in.

I'll take my bucket o' bits now...

[Edited by ~Bean~ on 08-06-2003 at 04:03 PM GMT]

____________________________
Eggheads unite! You have nothing to lose but your yolks.

08-06-2003 at 09:01 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
fabulous
Level: VB Guru


Registered: 03-08-2002
Posts: 439
icon Re: Running a macro at startup in PowerPoint

Thanx hey,

I did notice that AutoOpen doesn't work as expected which is where the problem started. But your help has opened my eyes to things I had not tried. You can have an extra bucket of bits for your trouble.

____________________________
My boss is a Jewish Carpenter (Jesus Christ)


Brain Bench Certified VB.NET Developer

22-06-2003 at 11:22 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Running a macro at startup in PowerPoint
Previous Topic (MsAccess Reports in VB)Next Topic (vba to vb possibly?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder