Results 1 to 13 of 13
  1. #1
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting up clipboard data

    Hi,

    I'd like to (if posssible) set up data into the clipboard so that in one paste operation, data gets copied into more than one textbox at a time.

    I'd be doing this in VB via the "clipboard.settext" method, but the same would apply if I was using something like "range.SetText" then "range.Copy".

    Our users are entering names into one system; then going to another system, and entering the name details again; they are doing this with a third system as well- and the volumes are fairly large.

    Both those systems are external, and we have no way whatsoever of modifying them.

    But if there was a way I could have them right click on a name, select "Copy for system A" from the dropdown menu, then in system A, the surname, given name1, given name2 and DOB fields get pasted into the correct places, it would be great.

    Sendkeys is one option, but I don't like to send "Alt + Tab" blindly without the user having control of which application is active.

    I have tried setting the text as "surname" & vbtab & "Given"; I've used other characters, but they all get pasted into the first textbox as a square character.

    Any thoughts please?
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting up clipboard data

    Am I to understand that you aren't allowed to program in the other applications (that you say are External)?

    Presumably a first step would be to create, say, 3 Word applications and send the paste-text to them. if that can't be got to work, then there is no hope.

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting up clipboard data

    Is there no way to OLE to these external systems?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Setting up clipboard data

    This might be a nice interface: create a "keep-on-top" but not modal palette with the information in nice discrete chunks. The user clicks in the entry field in the foreign application, then clicks on the item she wants to enter on the palette. The palette pops that information into the clipboard, relinquishes focus, and uses SendKeys or some other method to paste to the other application. The user then tabs and clicks, tabs and clicks. If the user is right-handed, this would be pretty efficient.

    Can it be done?? Let us know!

    BTW, I was fishing around on MS.com for something else and found this <A target="_blank" HREF=http://msdn.microsoft.com/library/periodic/period99/hm0199.htm>interesting article on the SendMessage API function</A>. If you can't get the right kind of floating palette with VBA properties, SendMessage might help.

  5. #5
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting up clipboard data

    Kevin,

    I don't know.

    I guess I could try to embed them in my application, but I don't think that would quite work.

    In the days of a mainframe application running in a PC window, I was able to achieve the same by DDE. Both the slave and master applications had to be DDE compliant for this to work.

    One of the applications is running under Citrix server. I cannot find anything there which implies I can do anything remotely, via DDE, OLE or ActiveX. I will check that out with the experts when they are back at work, but I expect there may well be alarm bells just for even daring to suggest that one application try to control another.

    I guess I was hoping for a quick "copy and paste" solution, but it does appear pasting is rather limited. It would at least not have triggered alarms.

    Thanks for the suggestion
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  6. #6
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting up clipboard data

    That's an idea- something like the clipboard in Office 2000 which allows multiple items of text on one clipboard. If only I could use that outside of Word.

    I'm not sure how I might implement it. Sendmessage definitely might help. I've never had to deal with handles before, and I've had very little to do with API calls, so I don't feel really confident on that side. But I will be investigating.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting up clipboard data

    <hr>Am I to understand that you aren't allowed to program in the other applications (that you say are External)?<hr>
    Yep. The belong to another organisation; some users have special rights to these applications. That org is much bigger than ours, so we don't have any push in asking for changes.


    <hr>create, say, 3 Word applications and send the paste-text to them.<hr>
    Not quite sure about that. Jeff's idea about a floating palette I think extends your idea. That has promise.



    <hr>there is no hope.<hr>

    I hope not.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  8. #8
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Setting up clipboard data

    Thanks for posting this link - really interesting article which got me thinking about some ideas unrelated to this thread.

    Quick question: according to some of the code samples, hwnd is a built-in property of controls in VB:

    (As in: SendMessage Text1.hwnd, etc.)

    When working within VBA, what method can you use to get the hwnd of a control, window or what have you? - presumably yet another API function?

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Setting up clipboard data

    Gary, the API functions I use test for the window title. However, I can't figure out a way to test whether any given "window" is the right one without a title. There probably is a way to drill down to just the controls on the UserForm (at least it has a Caption property) but as among those, I'm not sure how to do it.

  10. #10
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Setting up clipboard data

    Jeff,

    Thanks, what got me thinking about it was that "Clear Immediate Window" thread (kinda large thread, can't miss it<g>).

    In that case, we know the window name. So knowing that, the question is, is there an API function that would let us clear the contents of the window?

    Gary

  11. #11
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting up clipboard data

    Jeff,

    I'd be happy just knowing how to test the window title with API.

    Is that something you can do cycling through all active windows?

    Thanks
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  12. #12
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Setting up clipboard data

    I posted one version <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=vb&Number=18202>here</A>. You will note that it has an If loop to skip over "child" windows, as I was looking for main application windows in that routine. If you are looking for a child window (such as a UserForm), comment out the following line:

    If GetParent(lnghWnd) = 0 Then 'this is not a child window

    and the corresponding End If.

  13. #13
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting up clipboard data

    Jeff,

    Excellent Thank you.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •