Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   clipboard (http://www.outlookbanter.com/outlook-vba/70432-clipboard.html)

Joel Allen April 17th 08 03:52 AM

clipboard
 
Hello,

I have code that works well for copying text to a clipboard, but it's very
slow (5-10 seconds). It utilizes IE to do this. Is there a quicker way to
this - perhaps not having to rely on IE?


Sub CommandButtonClipBoard_Click()

On Error Resume Next

Dim strCopy

Dim objIE

JobYear = cstr(Year(Item.UserProperties("JobInitiatedDate")) )

strCopy =
"\\tgps8\drawing$\Jobs-"+JobYear+"\"+Item.UserProperties("JobNumber") +"
"+Item.UserProperties("JobName")

Set objIE = CreateObject("InternetExplorer.Application")

objIE.Navigate("about:blank")

objIE.document.parentwindow.clipboardData.SetData "text", strCopy

objIE.Quit

End Sub





Thanks,

Joel



Ken Slovak - [MVP - Outlook] April 17th 08 03:23 PM

clipboard
 
What language are you using?

If it's VBA code then your alternative is to use Win32 API calls to access
the clipboard, there are examples of that on the Web that you can google
for. If it's VB6 then just use the intrinsic Clipboard object.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Joel Allen" wrote in message
...
Hello,

I have code that works well for copying text to a clipboard, but it's very
slow (5-10 seconds). It utilizes IE to do this. Is there a quicker way
to this - perhaps not having to rely on IE?


Sub CommandButtonClipBoard_Click()

On Error Resume Next

Dim strCopy

Dim objIE

JobYear = cstr(Year(Item.UserProperties("JobInitiatedDate")) )

strCopy =
"\\tgps8\drawing$\Jobs-"+JobYear+"\"+Item.UserProperties("JobNumber") +"
"+Item.UserProperties("JobName")

Set objIE = CreateObject("InternetExplorer.Application")

objIE.Navigate("about:blank")

objIE.document.parentwindow.clipboardData.SetData "text", strCopy

objIE.Quit

End Sub





Thanks,

Joel





All times are GMT +1. The time now is 07:40 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com