Add cover page to document when printing | IFS Community
Solved

Add cover page to document when printing

  • 18 October 2019
  • 4 replies
  • 213 views

Userlevel 3
Badge +6

We are on App8 SP1+.  We have some documents that require special handling if they are printed out.  I can indicate which documents require this using a field on the document revision.  These documents can be Word, Excel or pdf.  Ideally I would like to have a cover page printed automatically anytime someone prints one of these documents.  The cover page would always be the same.  As an example it might say “Confidential Do Not Distribute”.  Any ideas on how to accomplish this or other suggestions to accomplish something similar.

Phil

icon

Best answer by Mathias Dahl 23 October 2019, 20:49

View original

4 replies

Userlevel 3
Badge +6

I should have been clearer.  These are document management documents.  Can report rules be used when printing from doc management?  We are using report rules for invoices so I am familiar with how they work.

Phil

Userlevel 7
Badge +17

Hi,

You can create a document macro that will be executed when the user prints the document. The macro can then, if the application supports scripting/automation (Word and Excel will work, not sure about PDF documents, it will depend on the viewer), add whatever is needed to the document before it is printed.

Document macros are described in the end-user documentation (search for “macros”) and you can learn how to set them up there. However, writing the actual macro “code” will depend on each document file type and use case, and you might need some help there. IFS Support services might be able to help you out there, or any of IFS’ partners (AddoVation, Din ERP, etc.).

Good luck!

/Mathias

 

Userlevel 3
Badge +6

I have figured out that I can create a macro that will open a web page.  I can use this to open a Sql Server Report Services report that can be used as a cover page.  The macro runs when the view button is clicked.  The web page opens up but the checked in document does not open to be viewed.  Do I have to add code to the macro to also open the document?  Below is what my test script looks like.

Phil

Public Sub Open_RS() 
Dim WscriptSchell
Set WscriptSchell = CreateObject("WScript.Shell")

WscriptSchell.Run "https://reportservices.xxx.com/Reports/Pages/Folder.aspx", 9

End Sub

Userlevel 7
Badge +17

Correct! Once you decide to use a document macro for a certain file operation you need to do everything yourself, including opening the document. The file name can be found in the collection of scripting attributes available to a macro. The documentation should have some simple example on how to access it I think.

 

Great that you got your first macro working, even if it is not complete yet! :-)

Reply