Capturing Keypress from Toolbar 
Author Message
 Capturing Keypress from Toolbar

Hi

I have a custom toolbar and would like to capture whether
a person has the Shift key pressed when selecting one of
the buttons.

The button then calls a module.

Is there any way you can capture key presses within a
module which has been called from a form?

Any help would be appreciated

R



Sat, 23 Oct 2004 14:33:55 GMT  
 Capturing Keypress from Toolbar
G'day All,
Using Win xp, Excel xp.

I download a web page and want to collect
the hyperlinks associated with some icons
in cells in the A column and put the strings
into L column.

    Dim rowCnt as Long, linkCnt as Long, ae as Long

    Workbooks.Open "webAddress"
        rowCnt = Worksheets(1).UsedRange.Rows.Count
        linkCnt = Worksheets(1).Hyperlinks.Count
        ae = 1
    Do Until ae > linkCnt
        ac = Application.WorksheetFunction.CountA(Range("L:L")) + 1
        aa1 = Worksheets(1).Hyperlinks(ae).Address
        Worksheets(1).Range("L" & ac).Value = aa1
        ae = ae + 1
    Loop

Problem is I want to know which Hyperlink came from each
particular data line.
If I do a similar search to the above code by looping down the cells in
the A column I retrieve nothing even though there are clearly many
icons with hyperlinks present.
What I want to find is the specific Hyperlink associated with each
cell in column A.
Any help appreciated!
Cheers, Peter J.



Sat, 23 Oct 2004 15:17:54 GMT  
 Capturing Keypress from Toolbar
The following routine can detect the state of the Shift, Ctrl & Alt keys.

Declare Function GetKeyState Lib "user32" _
    (ByVal nVirtKey As Long) As Integer

Const VK_SHIFT As Integer = &H10    'Shift
Const VK_CONTROL As Integer = &H11  'Ctrl
Const VK_MENU As Integer = &H12     'Alt

Sub KeyView()
    Dim msg As String
    If GetKeyState(VK_SHIFT) < 0 Then msg = msg & "Shift "
    If GetKeyState(VK_CONTROL) < 0 Then msg = msg & "Ctrl "
    If GetKeyState(VK_MENU) < 0 Then msg = msg & "Alt"
    MsgBox msg
End Sub


Quote:
> Hi

> I have a custom toolbar and would like to capture whether
> a person has the Shift key pressed when selecting one of
> the buttons.

> The button then calls a module.

> Is there any way you can capture key presses within a
> module which has been called from a form?

> Any help would be appreciated

> R



Sat, 23 Oct 2004 16:23:10 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Capture keypress

2. Capturing ENTER keypress

3. capturing keypress prevents reading field value

4. how to capture keyPress event from invisible PowerPoint forms

5. how to capture keyPress event from invisible PowerPoint forms

6. Capturing a keypress in a document?

7. Capturing Toolbars

8. repost: Capturing contents of WEB toolbar

9. Capturing close on a toolbar

10. Capture Excel Standard Toolbar control Click Event?


 
Powered by phpBB® Forum Software © phpBB Group