Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Sep 2001
    Location
    Stuck at work..., Missouri, USA
    Posts
    248
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select & Copy text in text box not working (2003)

    I have a database I use to generate the text that must be e-mailed to some managers. I have to use web-based e-mail, so I can't send directly via outlook or the like.

    I have the e-mail generated in a text box and then I select the code like this:
    <pre> Me.Text0 = strToPrint
    Me.Text0.SetFocus
    Me.Text0.SelStart = 0
    Me.Text0.SelLength = Len(Me.Text0)</pre>



    It highlights just fine, but if I Ctrl-C, I only get what is visible in the box, not the entire thing. To get the entire thing I have to manually select the entire text.

    Am I doing something wrong?
    <font face="Comic Sans MS">Morgan Erickson</font face=comic>
    morgan.erickson@sprint.com
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18>-From <img src=/S/flags/Colorado.gif border=0 alt=Colorado width=30 height=18> but living in <img src=/S/flags/Missouri.gif border=0 alt=Missouri width=30 height=18>...and working in Kansas.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select & Copy text in text box not working (2003)

    Two possibilities:
    <UL><LI>Me.Text0.SetFocus
    RunCommand acCmdCopy

    <LI>You could set a reference (in the Visual Basic Editor, select Tools | References...) to the Microsoft Forms 2.0 Object Library (C:WindowsSystem32FM20.dll). This library contains an object DataObject that can be used to put text on the Clipboard:

    Dim MyData As New DataObject
    MyData.SetText Me.Text0
    MyData.PutInClipboard
    Set MyData = Nothing[/list]Both will place the contents of Text0 on the clipboard, ready to be pasted.

  3. #3
    3 Star Lounger
    Join Date
    Sep 2001
    Location
    Stuck at work..., Missouri, USA
    Posts
    248
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select & Copy text in text box not working (20

    Option 1 worked, thank you.

    Why, though, did my code act like it did?
    <font face="Comic Sans MS">Morgan Erickson</font face=comic>
    morgan.erickson@sprint.com
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18>-From <img src=/S/flags/Colorado.gif border=0 alt=Colorado width=30 height=18> but living in <img src=/S/flags/Missouri.gif border=0 alt=Missouri width=30 height=18>...and working in Kansas.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select & Copy text in text box not working (20

    Sorry, I don't really know.

  5. #5
    3 Star Lounger Omega3's Avatar
    Join Date
    Jan 2004
    Location
    Los Angeles, California, USA
    Posts
    343
    Thanks
    2
    Thanked 1 Time in 1 Post
    [quote name='HansV' post='615805' date='22-Nov-2006 13:18']Dim MyData As New DataObject
    MyData.SetText Me.Text0
    MyData.PutInClipboard
    Set MyData = Nothing[/list]Both will place the contents of Text0 on the clipboard, ready to be pasted.[/quote]
    This second option is what I would like to do. I'm using Access 2003 and it doesn't have a Microsoft Forms x.0 library but my PC does have the FM20.DLL file. Does Access still have it under a different library name?
    You know it's time to diet when you push away from the table and the table moves.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The FM20.DLL file *is* the Microsoft Forms 2.0 Object Library. To set a reference to it in Access, select Tools | References... in the Visual Basic Editor, click Browse..., navigate to C:\Windows\System32 and select FM20.DLL, then click Open and OK.

  7. #7
    3 Star Lounger Omega3's Avatar
    Join Date
    Jan 2004
    Location
    Los Angeles, California, USA
    Posts
    343
    Thanks
    2
    Thanked 1 Time in 1 Post
    [quote name='HansV' post='779190' date='10-Jun-2009 12:29']The FM20.DLL file *is* the Microsoft Forms 2.0 Object Library. To set a reference to it in Access, select Tools | References... in the Visual Basic Editor, click Browse..., navigate to C:\Windows\System32 and select FM20.DLL, then click Open and OK.[/quote]

    I got it now. I was expecting to see it in the list that is displayed when you do Tools | References but I couldn't find it in the list. I didn't think about browsing to it. Thank you for that clarification. Have a wonderful day!
    You know it's time to diet when you push away from the table and the table moves.

Posting Permissions

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