
CChong2 (Flexera) asked a question.
Session.FormatRecord and VBScript
Hello!
I'm a bit confused about the use of Session.FormatRecord. It seems to me that it is not well documented. I tried to use it to retrieve some properties, bu it doesn't seem to wrok. :(
It this the correct way to use it?
set rcd = Installer.createrecord(3)
rcd.stringdata(0) = "[1] ... [2]"
rcd.stringdata(1) = "[filename.ext]"
rcd.stringdata(2) = "[ProductName]"
session.FormatRecord(rcd)
msgbox rcd.stringdata(0)
Any ideas? Any link? Any documentation?
Thanks.
[code]Set oRec = Installer.CreateRecord(2) ' field zero isn't included
oRec.StringData(0) = "Hello, [1] on [2]!"
oRec.StringData(1) = "[LogonUser]"
oRec.StringData(2) = "[ComputerName]"
strFormattedText = Session.FormatRecord(oRec)
MsgBox strFormattedText[/code]
Yes, it works. Thank you alot. By the way, check this link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/session_formatrecord.asp
In the official documentation, there is no return value for Session.FormatRecord. However, your example vorks very well. Strange...
Thanks.
" The FormatRecord method of the Session object returns a formatted string from a template and record data. "
followed by
" This method has no return values. "