Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mellerbeck
Creator II
Creator II

How to export the text of a variable

I've been able to export an object to xml using

set oTable = ActiveDocument.GetSheetObject( "Note_Export" )

oTable.ExportXml "\\RemotePath\Test\" + sFileName

It looks like I can get the text of a variable by doing

set Var = ActiveDocument.Variables("Note").GetContent.String

But how to save this to a file?



1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Michael,

There is no direct QV API call to write variable values to a file. You can use the FileSytemObject to write the date. For example, see DocAnalyzer. However, this requires System Access.

As an alternative, you can put the variable in a chart as an expression and export the chart. No System Access required. See attached. Test it out, I got some funny results when I used a multi-line note. Any of the various Export API methods, Export, ExportEx with format, ExprtHtml should work

-Rob

View solution in original post

4 Replies
mellerbeck
Creator II
Creator II
Author

This is from a macro that is called from a button

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Michael,

There is no direct QV API call to write variable values to a file. You can use the FileSytemObject to write the date. For example, see DocAnalyzer. However, this requires System Access.

As an alternative, you can put the variable in a chart as an expression and export the chart. No System Access required. See attached. Test it out, I got some funny results when I used a multi-line note. Any of the various Export API methods, Export, ExportEx with format, ExprtHtml should work

-Rob

mellerbeck
Creator II
Creator II
Author

Thanks Rob! So I'm trying to find a good way to record permanant 'Notes' into a DB. If I use a table box with an inputfield or a ListBox it won't line wrap during text entry (after hitting enter it line wraps just fine) so my reasoning was I could use an input box and have them press the edit expression and allow them to do a multi line note. It Doesn't seem like there is a super easy way to do this though.