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!

Taking an .rtf document and inserting characters in it

Status
Not open for further replies.

monak

MIS
Jul 2, 2002
22
US
Hi ,

I need some help on creating a macro. This is my first time using VBA. What I am trying to is take a existing .rtf file and search through it and find any string that has a strikethrough and a redfont. Once I find it I want to insert the symbol [& &] around the string to indicate that the string has a strikethrough and a red font.

Here's what I want to do in rough terms:


open .rtf file
dim strvar as string

***this where I am stuck***

// break up the whole line
strvar = I want to assign this value to text in my .rtf file
Is there a equivalent to a strtok function?

rtfvar = parameters in the line

if rtfvar == '/strike' then
// move to next parameter
if rtfvar== '/cf6' then
// then insert [& in front of string= '[&' + Left(strvar)
Right(strvar) + '&]'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top