We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Transform a Word document in PDF and fill in the fields on the PDF document

ivoiculescu2020
8 - Asteroid

Dear team,

 

I need your help again: I need to fill in a form every month when I review the accounts in a particular system. This way I keep a track of who is deactivated, who didn't access the system in a long time and who is still active.

Is there a way in Alteryx to:

 

- turn a Word document into a PDF

- fill in the fields on the pdf document with some template-like text

- combine the pdf with the monthly user report

 

If I can create some sort of dynamic app to have this document ready, it would help me tremendously.

 

Your suggestions are greatly appreciated!

Regards,

Ioana

 

2 REPLIES 2
gabrielvilella
14 - Magnetar

Alteryx cannot read Word documents. If you have the Intelligence Suit package you can read in PDF, BMP, JPEG, PNG. Another way could be developing a Python code to read DOCX. 

RAVE
7 - Meteor

If you save the code below as a macro in Word and run it, it will prompt you for the directory you have your documents in and will convert them to a PDF.  The PDF documents are placed back in the same directory.  It does about a document each second. Then you can use Alteryx to read the PDF. 

Sub SaveAllAsPDF()

Dim strFilename As String
 Dim strDocName As String
 Dim strPath As String
 Dim oDoc As Document
 Dim fDialog As FileDialog
 Dim intPos As Integer
 Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
 With fDialog
     .Title = "Select folder and click OK"
     .AllowMultiSelect = False
     .InitialView = msoFileDialogViewList
     If .Show <> -1 Then
         MsgBox "Cancelled By User", , "List Folder Contents"
         Exit Sub
     End If
     strPath = fDialog.SelectedItems.Item(1)
     If Right(strPath, 1) <> "\" Then strPath = strPath + "\"
 End With
 If Documents.Count > 0 Then
     Documents.Close SaveChanges:=wdPromptToSaveChanges
 End If
 If Left(strPath, 1) = Chr(34) Then
     strPath = Mid(strPath, 2, Len(strPath) - 2)
 End If
 strFilename = Dir$(strPath & "*.doc")
 While Len(strFilename) <> 0
     Set oDoc = Documents.Open(strPath & strFilename)
     strDocName = ActiveDocument.FullName
     intPos = InStrRev(strDocName, ".")
     strDocName = Left(strDocName, intPos - 1)

'This instruction converts to PDF 

       strDocName = strDocName & ".pdf"
     oDoc.SaveAs FileName:=strDocName, _
         FileFormat:=wdFormatPDF

     oDoc.Close SaveChanges:=wdDoNotSaveChanges
     strFilename = Dir$()
 Wend
 End Sub

Labels
Top Solution Authors