Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying RTF to clipboard

Status
Not open for further replies.

KM8888

Programmer
Nov 21, 2011
69
US
Hi all,

I'm facing an issue with trying to copy an RTF string to the clipboard, I've seen examples in VBA but not in VBScript. I want to avoid creating a word object to copy this string, this is just an example string from a vba example I saw

Dim sRTF
sRTF = "{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl" & _
"{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}" & _
"{\f2\froman\fprq2 Times New Roman;}}" & _
"{\colortbl\red0\green0\blue0;\red255\green0\blue0;}" & _
"\deflang1033\horzdoc{\*\fchars }{\*\lchars }" & _
"\pard\plain\f2\fs24 Line 1 of \plain\f2\fs24\cf1" & _
"inserted\plain\f2\fs24 file.\par }"


I then would like to put this string on the clipboard in it's rich text format so when I paste, it comes out as it would if that string was written to an RTF file. Is this possible?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top