Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have written a macro to export the straight table in a qvw to a flat file (.txt) file and was able to specify the delimiter i wish to.
The macro which i used is as follows:
sub Export
Dim docProp
set docProp = ActiveDocument.GetProperties
Dim tmpFile 'used to create relative filepaths
tmpFile = docProp.MyWorkingDirectory
tmpFile = tmpFile & "External Data Sources\OperationalReportsOutput\"
set obj = ActiveDocument.GetSheetObject("CH01")
obj.Export tmpFile & "Activity" & ".txt",";"
end sub
Now i have to change the output data to a fixed length datatype. It means for suppose, i have 3 fields
Name Address Phonenumber
Sam Greenville,USA 2159627856
Vizard Charlotte, USA 2527255632
If i gave a fixed length of 20 to the fields:and i specify no delimiter,
the output should look like
Sam Greenville,USA 2139627856
Vizard Charlotte,USA 2527255632
So every record in the text file should end at the same point.
Any ideas!
Yes, It is working. Thank You
But just as a question, can we do it in macro! i mean fixed length fields while exporting
Yes. Macro's are just vbscript. Find a good vbscript site to find out how to manipulate strings and write them to a file.