Windows 7 - format output to Rich Text, HTML or TEXT

Asked By Chri on 20-Feb-08 04:14 PM
I need to write a VBscript and write the output to Rich Text, HTML and TEXT
format files.  I also need to format it with bold for title, different fonts
for some items.  I tried Word and it works.  But in our company Word has
integrated with a document management software so once Word launched it got a
popup on users' desktop.  So, I'm thinking to wrote the format in the script
for each output but can't find a way how to do it with the format, especially
for RTF.  Is there instructions for how to do this?  or a sample code? or
suggestions?

thanks.




Pegasus \(MVP\) replied on 20-Feb-08 04:36 PM
Just to clarify your post: In your first thread you were not advised to
Set objWord = CreateObject("Word.Application")
which apparently causes problems in your company.
Chri replied on 20-Feb-08 05:29 PM
Thanks for pointing it out.  BTW.  Do you know how to use showresults with
VBScript?  It's part of cmdlib.wsc in XP.

progid = Microsoft.CmdLib

CheckScript used to find whether CScript is used or not
vbPrintf Simulates the Printf function
getHostName used to get the current Host name
getUserName used to get the current User Name
getDomainName used to get the current Domain name
getPassword used to get the password from the user
trapError Reports error with a string saying what the error occurred in
getArguments used to get the arguments into appropriate variables
wmiConnect used to connect to wmi provider with the given credentials
packString Attaches spaces to a string to increase the length to intWidth
getMaxStringLen used to get length of the maximum length string in an array
of strings
showResults used to show results in the desired format
validateDateTime To validate the date-time format specified
changeToWMIDateTime To format the given date-time
matchPattern checks whether a given value matches a particular pattern

Thanks.
Owen Gilmore replied on 21-Feb-08 06:11 AM
T
onts
as
t a
ript
lly
or

If I were you I'd look at powershell, which has a lot more powerful
formatting functions than VBscript.