RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2017-06-25T18:42:32Z
I want to create a procedure that copies the entire contents of the grid (with headers) to the clipboard.

I tried the following but it does not work.

With iGrid1
    .BeginUpdate
        
    .MultiSelect = True
    .SelectAll
    .DoKeyboardCommand vbKeyC, vbKeyControl + vbKeyShift
    .MultiSelect = False
        
    .EndUpdate
End With
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2017-06-26T15:54:07Z
I also tried changing the DoKeyboardCommand line to:

.DoKeyboardCommand 67, 3

...but it didn't help.

By the way, the code is running from a form button in Access 2010.
Igor/10Tec
2017-06-26T16:09:47Z
The 2nd optional Shift parameter of the DoKeyboardCommand method expect other values. Here is the description of the Shift parameter from the help file:

引用:

An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event. The Shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT are pressed, the value of Shift is 6.



vbKeyControl = 17 and vbKeyShift = 16, so these are not the right constants to use in the Shift parameter. If you were developing in VB6, you would use vbCtrlMask (2) and vbShiftMask (1) respectively.

However, you are right. There is a problem with the Shift parameter set to 3 in the current official version of iGrid (though 2, or vbCtrlMask without vbShiftMask works). I have just fixed this problem in an interim build of iGrid and sent it to you to check.
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2017-06-26T16:20:56Z
New version tested and working.

Thank you, Igor. Fantastic support.