Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Not applicable

Data from Listbox selection in Mail Subject with VBA Macro

Hi,

I have this VBA script that send emails with data from QlikView for every selection in the Listbox separately.  I need some help to insert the data that i selected in the listbox in the subject of the email.

objMsg.Subject = "Daily Mail and Inbound Calls Report" &" "& Date-1

The ObjectID for the Listbox is LB26

Thanks.

Tags (2)
1 Solution

Accepted Solutions
Highlighted
mwoolf
Honored Contributor II

Re: Data from Listbox selection in Mail Subject with VBA Macro

If there will be only one selected value:

set val=ActiveDocument.Fields("Month").GetSelectedValues

strSelection = val.Item(0).Text

.

.

objMsg.Subject = strSelection

View solution in original post

3 Replies
Highlighted
mwoolf
Honored Contributor II

Re: Data from Listbox selection in Mail Subject with VBA Macro

It doesn't matter what the listbox ID is. The code relies on the selections in the field:

set val=ActiveDocument.Fields("Month").GetSelectedValues

for i=0 to val.Count-1

    if val.Item(i).IsNumeric then

       msgbox(val.Item(i).Number)

    else

       msgbox(val.Item(i).Text)

    end if

next

Highlighted
Not applicable

Re: Data from Listbox selection in Mail Subject with VBA Macro

Thanks for your answer but i don't know how to mount it in objMsg.Subject

Highlighted
mwoolf
Honored Contributor II

Re: Data from Listbox selection in Mail Subject with VBA Macro

If there will be only one selected value:

set val=ActiveDocument.Fields("Month").GetSelectedValues

strSelection = val.Item(0).Text

.

.

objMsg.Subject = strSelection

View solution in original post