View Single Post
  #4   Report Post  
Robert M. Franz
 
Posts: n/a
Default

Hi Prakash

Prakash Mistry wrote:
I want to output a report, like a price list.
Begins with a header: cented, 20 point, bold, underlined

_*XYZ COMPANY - PRICE LIST JAN 04*_

_*Category: S1 - Dishes*_
__
*Code Description Box Qty Price*
ABC001 12" white ceramic 12 45.90
etc.

So I need to markup the text as it is produced.
HTML markup is not ideal for me.
Is it not possible to markup with Word/Wordpad formatting command?


Hmm, of course this is possible, I guess I'm beginning to understand.


I don't want the end user to have to do any formatting.
Can i search/replace characters with formatting commands?
e.g. ##XYZ COMPANY -... where ## repalced by whatever I need to make it bold.


OK, this works, yes. A Word file is quite different than HTML (it's not
a text file at all), but you can still do what you want. Edit | Replace
is the place to turn to at first, using Word's own version of Regular
Expressions. Aside to Word's Help menue, the following two articles will
shed some light for you:

Add Power to Word Searches with Regular Expressions (by Colin Wilcox,
Graham Mayor, and Klaus Linke)
http://office.microsoft.com/assistan...wildcards.aspx

Finding and replacing characters using wildcards (by Graham Mayor and
Klaus Linke)
http://word.mvps.org/FAQs/General/UsingWildcards.htm


I am sorry if I seem confused but all I want is a plain text to produce the above
(on demand, repeatedly) the above formatting.


No need to be sorry, supposedly none of us is writing in his mother
tongue here. :-)

For repeating these steps, you'll need VBA. Depending on how big the
text files are (and/or how frequently the macro should run), you can get
away with recording your replace runs. Scratching out unneccessary
entries in the recorded code might pay off a bit, but for the finer
stuff, you need to rewrite a bit more I guess.

Greetinx
..bob
--
/"\ ASCII Ribbon Campaign | MS
\ / | MVP
X Against HTML | for
/ \ in e-mail & news | Word