Question

Document macros - check in, view, create new

  • 26 October 2020
  • 4 replies
  • 750 views

Badge +3

Hi everyone,

i have question about document management macros. I want connected word tempalte document to the row in application (for example row of audit) and after create new document, or after attach i want the data from application to be filled into a word file.

I have some macros block from enviroment test TQA CMB. But macros are only functional when i do checkout file (edit) - then is data filled into file.

I think that the macros for action create new, and check in doesn´t work. 

 

You dont have anyone sample macros for there actions please? I dont know employees who would be familiar with writing these macros.

And another question is, it is possible to filled data from row to the fille at the action “VIEW” - do you know?

 

I will be happy for any answer, thanks.

 

 

 


4 replies

Userlevel 7
Badge +24

hi @dockal_d 

The View part is easy - the answer is Yes.  You can have a macro run upon viewing the word document and it will update fields with data from IFS.

It is also possible to run macros on New, and Check-in (although Check-In is less clear to me).

Make sure you have fully set up the IFS Page: Document Class Process Action, and/or Document Class Management/Macros tab.  Try both, if one doesn’t work as expected.

For testing, use  MsgBox frequently.  This is your way to know whether the code is running and reaching a certain point.

e.g.

msgbox "The code is running here"

...

Badge +3

hi @dockal_d 

The View part is easy - the answer is Yes.  You can have a macro run upon viewing the word document and it will update fields with data from IFS.

It is also possible to run macros on New, and Check-in (although Check-In is less clear to me).

Make sure you have fully set up the IFS Page: Document Class Process Action, and/or Document Class Management/Macros tab.  Try both, if one doesn’t work as expected.

For testing, use  MsgBox frequently.  This is your way to know whether the code is running and reaching a certain point.

e.g.

msgbox "The code is running here"

...

Hi, thanks for answer. When i created a new document (with document class with macro definition - check in, check out, create) and attached to the object,  was displayed dialog with macro runing “Check in” a press OK and then i got message box what i defined. But then when i open the file is empty… The data is filled only when i do edit document (check out)

 

Document Class Process Action, and/or Document Class Management/Macros tab i have set up.

 

Maybe if im missing a some block in the macro for checkIn?

 

 

Badge +3

There is detail of block of WORD_CHECKIN (im trying checking type of file WORD). You now if this macro block is correct please? or there may be something wrong?

PUBLIC FUNCTION WORD_CHECKIN_MSOFFICE()
ON ERROR RESUME NEXT

O_APP.NORMALTEMPLATE.SAVED = TRUE
O_APP.VISIBLE = FALSE
SET O_DOC = O_APP.DOCUMENTS.OPEN(IFS_CHECK_OUT_PATH & O_FILENAME)    
O_APP.APPLICATION.DISPLAYALERTS = 0
O_APP.ACTIVEDOCUMENT.SAVE

O_APP.ACTIVEWINDOW.ACTIVEPANE.VIEW.SEEKVIEW = 0

PDF = O_APP.ACTIVEDOCUMENT.EXPORTASFIXEDFORMAT (O_DOC.PATH & "\" & LEFT(O_DOC.NAME,INSTR(O_DOC.NAME,".")-1) & ".PDF", 17, FALSE,  0, 0, 0)

O_DOC.CLOSE 0
O_APP.QUIT
SET O_DOC = NOTHING
SET O_APP = NOTHING

END FUNCTION

Userlevel 7
Badge +30

The check in macro block above seems to only create a PDF file for you, it has nothing to do with filling in the document itself with data.

Is this in Aurena or IEE?

 

Reply