0
votes

I wanna do a simple script that clears the MS Office Clipboard using some VBA code adapted to VBS code.

I Tried this:

Dim XLapp Set XLapp = CreateObject("Excel.Application")

XLapp.CutCopyMode=False

didnt work!

1
Possible duplicate of Clearing the clipboard using VBScriptEylM
@FlorentB.CreateObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") does not work in VBScript.TinMan

1 Answers

0
votes

If you are going to writing VBScript then you should download VbsEdit. It is free to use but well worth the price if you are going to be writing a lot of scripts. It also comes with HTAEdit.

VbsEdit Screenshot

VbsEdit Local Window Screenshot

Using the sample script you can clear the ClipBoard like this:

Dim toolkit
Set toolkit = CreateObject("vbsedit.toolkit")
toolkit.PutClipboardText ""

Or simple

CreateObject("vbsedit.toolkit").PutClipboardText ""

Note: you can not create a DataObject in VBScript. CreateObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") will work in VBA but will fail in VBScript.