473,465 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I am working on vba PowerPoint. I am new in vba so kindly bear me. I'm trying to capt

2 New Member
Expand|Select|Wrap|Line Numbers
  1. Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort
  2.  
  3. Sub ScreenOnkey(ByRef Target As Range)
  4. Dim index As Integer
  5. index = 0
  6. mb = InputBox("You name please")
  7.  
  8. While index <= mb
  9.  
  10.     If (GetAsyncKeyState(VK_SNAPSHOT)) Then
  11.  
  12.         Sleep 250
  13.  
  14.         keybd_event VK_MENU, 0, 0, 0
  15.         keybd_event VK_SNAPSHOT, 0, 0, 0
  16.         keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0
  17.         keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
  18.  
  19.         index = index + 1
  20.     End If
  21.         ActivePresentation.Slides.Add 1, ppLayoutBlank
  22.         ActivePresentation.Slides(1).Shapes.Paste
  23. Wend
  24.  
  25.  
  26. End Sub
  27.  
Now problem is when i run my macro it is not concluding the ScreenOnkey. Thanks
Dec 24 '14 #1
1 1100
Ali55555551
2 New Member
I am working on vba PowerPoint. I am new in vba so kindly bear me. I'm trying to capture the active screen using GetAsynKeyState function. And paste it to PowerPoint .Following is the code in which it should work when i press key VK_MENU.
Dec 24 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Adam T. Gautier | last post by:
I have been unable to solve a problem. I am working with MD5 signatures trying to put these in a database. The MD5 signatures are not generated using the python md5 module but an external...
1
by: Bob | last post by:
Hi, Is there something like BackgroundPrintingStatus in PowerPoint? I was trying to locate something like it, but no luck? Otherwise, is that possible to inhibit background printing...
2
by: ianLOSEatTHEaltispartnersCAPS.com | last post by:
Hello, First and foremost appols for what must be the n-billionth "new programmer" post you've had but if someone could see their way clear to helping me, or just recomending some reading I...
2
by: ssjassal | last post by:
Is there a way to instruct Python to import modules from standard library even if there is one with the same name in the current working directory? I was trying to import BaseHTTPServer.py from...
9
by: MattC | last post by:
Hi, Not sure if this is the correct forum, so apologies in advance, if it's not. I have a requirement to dynamically generate a powerpoint slide via a webpage. My first thought was some knid...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
8
by: Seth Darr | last post by:
I'm working on migrating an Classic ASP/VB6 COM application from an NT Server with IIS<6 to an virtual machine running Windows Server 2003 and IIS 6. I've worked through most of the obvious...
7
by: karamorf | last post by:
Im having problems getting the window.open function to work properly in internet explorer. The code works fine in firefox, but thats not really an option (cant just force everyone to use that to be...
6
by: BWPanda | last post by:
Hi everyone, I'm wanting to use VB.NET to display a powerpoint presentation, much the same way as the presenter that comes with PowerPoint (when used on multiple monitors). Basically, I want to...
2
by: LucasLondon | last post by:
Hi, I'm trying to use VBA to extract underlying data from charts in powerpoint to excel, i.e from the underlying powerpoint datasheet that feeds the chart. I've found the macro below on the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.