Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
Not applicable

manage document properties with macro

Hello,

I wrote a macro that puts an image on the background and prints the sheet.

But I have to prohibit the print by file menu (Print File, Print PDF ecc) so the only way to print for the users will be the button with the macro.

I know that in the “setting” menu, you can manage by “document properties”, by flag “allows printing (when export is prohibited)”, but if I disable flag the macro doesn’t works….

The question is: is possible to manage this flag inside the macro, so I can put this flag, run the other script of the macro, and then disable the flag?

If is not possible there is other way to do that??

Thanks in advance for your answer

Ivan

MACRO CODE:

sub WP

set temp = ActiveDocument.GetApplication.GetProperties


status = ActiveDocument.SetWallPaper("\\link\pippo.jpg", 1)

set docprop = ActiveDocument.GetProperties

docprop.UseBkgImage = true

ActiveDocument.SetProperties docprop

rem ** set document for fit to page landscape sheet printing **

set docstampa = ActiveDocument.GetProperties
set ps = docstampa.PrintSheetSettings
ps.Landscape = true
ps.PagesX = 1
ps.PagesY = 1
ps.PrintCurrentSelectionPosition = 4   'bottom
ps.UseScale = false                    'fit to page
ActiveDocument.SetProperties docstampa


set s=ActiveDocument.ActiveSheet

s.Print true


docprop.UseBkgImage = false

ActiveDocument.SetProperties docprop


end sub

Tags (2)
3 Replies

manage document properties with macro

Hi,

    

   Here is the code i found from API guide.

temp=ActiveDocument.GetProperties

temp.UserPermissions.AllowPrintAnyway = false

ActiveDocument.SetProperties temp

   At my side its not working properly. You can try your side.

Regards,

Kaushik Solanki

MVP & Luminary
MVP & Luminary

manage document properties with macro

The AllowPrintAnyway property in the API is read-only.

-Rob

jafari_ervin
Contributor III

manage document properties with macro

if AllowPrintAnyway is read only why this macro exist in API Guide?

(

temp=ActiveDocument.GetProperties

temp.UserPermissions.AllowPrintAnyway = false

ActiveDocument.SetProperties temp

)