Hi,
I am trying to lounch APFill from VBA code and I have no success so far.
My code is generating a pdf file in current directory and I want to start APFill to process that pdf and generate a text result in the file: fisier_txt.
Dim apfill_exe As String
Dim Path As String
Dim fisier As String
Dim fisier_txt As String
Path = ActiveDocument.FilePath
fisier = Left$(ActiveDocument.FileName, Len(ActiveDocument.FileName) - 4) & ".pdf"
fisier_txt = Left$(ActiveDocument.FileName, Len(ActiveDocument.FileName) - 4) & ".txt"
apfill_exe = "c:\Program Files\APFill\APFill.exe -r150 -noprogress"
this line I cannot make to work:
Call Shell(Environ$("COMSPEC") & " /c " & apfill_exe & Path + "\" + fisier & fisier_txt, vbNormalFocus)
Please help
lounching APFill from VBA
Re: lounching APFill from VBA
Hello
I think the issue can be in missing "" for a apfill.exe long path and files parameters. Also you should use keyword COVERAGE if you use output file name.
In case of long paths the result shell start line should be:
Also It seems that you've missed spaces between connected strings. So the line should be:
Details:
https://avpsoft.com/blog/2009/09/22/apfill_automate/
I think the issue can be in missing "" for a apfill.exe long path and files parameters. Also you should use keyword COVERAGE if you use output file name.
In case of long paths the result shell start line should be:
Code: Select all
"C:\Program Files\APFill\APFill.exe" coverage -r150 -noprogress "c:\input.pdf" "c:\output.txt"
Code: Select all
apfill_exe = """c:\Program Files\APFill\APFill.exe"" -r150 -noprogress"
Call Shell(Environ$("COMSPEC") & " /c " & apfill_exe &" "&""""& Path + "\" + fisier&""" """& Path + "\" +fisier_txt&"""", vbNormalFocus)
https://avpsoft.com/blog/2009/09/22/apfill_automate/