Question

JS/VB script auto create PDF when office docx checked in

  • 23 December 2021
  • 3 replies
  • 106 views

Userlevel 7
Badge +16
  • Hero (Customer)
  • 528 replies

Community,

 

wondering who can share the Java or VB script that could auto create PDF when Microsoft office document, e.g. DOCX are checked in.

 

Thank you in advance.


3 replies

Userlevel 6
Badge +11

@ronhu 

Hi ronhu,

 

Please try the attached macro blocks. In this scenario if you check-in a docx file pdf also get attached to the system and pdf file will be saved in the same location.

I have separated the each macro block start end comments.

 

Regards,

Sahan

 

 

Userlevel 7
Badge +16

@Sahan Udana Appreciated. will try.

Userlevel 7
Badge +30

FYI, just some friendly hints:

All these calls are probably not needed:

A2A("ACTUAL_FINISH")A2A("ALTERNATE_DOCUMENT_NUMBER")

Because, if you check the source code for A2A you can see it sets values in O_DOCARRAY, but O_DOCARRAY is never used anywhere in the macro for anything else. So you can remove those calls as well as the A2A procedure itself.

Also, you do not need uppercase for all the code. Probably it would be more readable by using a more standard VBScript “syntax”. And some indentation would not hurt either :)

@ronhu let us know if you got the code to work.

 

Reply