Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
first of all, thanks a lot in advance.
I have this macro to send an email and attach a file to it.
Sub Send()
Set objOL = CreateObject("Outlook.Application")
Set objMsg = objOL.CreateItem(olMailItem)
objMsg.Attachments.Add "c:\test\country_samplefile1.txt"
objMsg.subject = "Subject line"
objMsg.body = "Total amount is: sum(price)"
objMsg.to = "country@domain.com"
objMsg.Display
End sub
I have a field in QV which is country.
Depending in the value selected in country I want the macro to send the specific test file for that country,
For instance if I select Germany in the field country, I want the macro to send the file:
c:\test\Germany_samplefile1.txt
In addition, in the body of the email, I need the macro to get the value of sum(price).
How can I achieve this?
I have read about ActiveDocuments and all that, but I am quite lost.
Thanks a lot in advance.
A simple approach for both is use the Evaluate() function.
totalPrice = ActiveDocument.Evaluate("sum(price)")
country = ActiveDocument.Evaluate("only(country)")
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
A simple approach for both is use the Evaluate() function.
totalPrice = ActiveDocument.Evaluate("sum(price)")
country = ActiveDocument.Evaluate("only(country)")
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
One other link, the QVW file that contains all the QlikView API calls, which may be helpful too:
Regards,
Brett
By the way @Brett_Bleess , that API Guide link is for V10. I posted that in a doc feedback a couple of years ago, but it's never been updated. There is a V11 version floating around, but AFAIK there has never been a V12 published. Do you know if a V12 doc exists?
-Rob
@rwunderlich Thanks, I am not sure how the heck I missed that, but I have flagged it to the Doc Team again, so hopefully they can verify latest release that contains all updates and get that in there instead. I do not the APIs have been updated at all in the 12 tracks and as far as I am aware there are no plans to provide further updates either. The APIs are as-is at this point. In the 11.20 track, I believe the API Guide was included in the Full Documentation and Tutorial installer if I recall correctly, but I will let the Doc Team look into things at this point, thanks again for the flag on this.
Regards,
Brett