Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gradiske
Contributor III
Contributor III

Get content from ActiveDocument.Fields()

Hi guys, im having a little trouble here.

What im trying to do is, set a var with the content of a ActiveDocument.Fields.

I tried this at first

sub testvar

f = ActiveDocument.Fields("email").SelectAll

msgbox(f)

end sub



But all im getting on this is "TRUE"... i want to display the content of this selection... but let me explain one thing, i know that is ONLY ONE possibility on this selection... cause its based on section access so, when the person is using the application, the field "email" will only return his email.

I've tried the ".GetContent.String" that i use a lot with "ActiveDocument.Variables" but got no success...

2 Replies
Not applicable

Here's the first part of what you want to do:

Set val=ActiveDocument.Fields("email").GetPossibleValues
current_email=val.item(0)

At that point you will have the email field value in the vbscript variable current_email. Then you need to put that into a document variable

Not applicable

Hello gradiske, Tim Benoit

I have a similar problem. I have one field ReloadDate which carries only the date when the report was reloaded. I need to compare ReloadDate with current date in a macro written using VBScript.. so how can I do that? 

I tried with

set dte = ActiveDocument.Fields("ReloadDate").GetPossibleValues

if  (dte = Date) then

------------------

end if

But the type mismatch error occures. Also tried with

if  (dte.item(0) = Date) then

------------------

end if

But again "Wrong number of arguments or invalid property assignment: 'dte.item'" error occures.

How to fix the issue??

Please reply