I want to put into a variable, the text content of the clipboard ! I can paste, but not copy ! So, my question is : How to store the contents of the clipboard into a variable ?
' Set what you want to put in the clipboard '
strMessage = "Hello World"
' Declare an object for the word application '
Set objWord = CreateObject("Word.Application")
' Using the object '
With objWord
.Visible = False ' Don't show word '
.Documents.Add ' Create a document '
.Selection.TypeText strMessage ' Put text into it '
.Selection.WholeStory ' Select everything in the doc '
.Selection.Copy ' Copy contents to clipboard '
.Quit False ' Close Word, don't save '
End With