get the clipboard value into a vba string

  • Thread starter Thread starter oldyork90
  • Start date Start date
O

oldyork90

I have a macro that pastes the clipboard (I think it's the clipboard)
value into the body of my email. Here is the line that does it

Selection.Paste

How can I get that value into a string so I can test the value?

Thank you.
 
In Outlook, you may use the MSForms library for that: Add a UserForm to your
VBA project, and see the DataObject and its methods in the object browser.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Wed, 1 Oct 2008 06:44:27 -0700 (PDT) schrieb oldyork90:
 
From one of your previous posts...

The Outlook objct model doesn't offer a way to work with the
clipboard. If
you add a UserForm to your VBA project, the MSForms library will be
referenced, which in turn offers a DataObject.

I don't see that lib listed. Went to TOOLS->REFERENCES and looked for
"MSForms". Saw nothing like it. Is this something that is available
to everyone? Outlook SP3 - MS Office Professional Edition 2003

Libs I have are: Office, Outlook, VBA, Project1, stdole
 
You should see Microsoft Forms 2.0 Library (C:\Windows\System32\FM20.DLL)
there, it's the library of controls used in Outlook custom forms and every
Outlook installation installs it.
 
You should see Microsoft Forms 2.0 Library (C:\Windows\System32\FM20.DLL)
there, it's the library of controls used in Outlook custom forms and every
Outlook installation installs it.

No. I swear it was not installed. This would not work:

Dim DataObj As MSForms.DataObject
Set DataObj = New MSForms.DataObject

Now it does. Thanks. By-the-way, I had to install it twice. If I
hit ALT-F11 from a mail message, I get one env, if I ALT-F11 directly
from the Outlook application, I get another.

Thanks again.
 
Back
Top