I wish to run a dll from within MS. This is the sample code for Visual Basic. How should I change it for MS?
Public Declare Function GetPDFText Lib "PDFtext.dll" (ByVal FileName As String, ByVal opt As Long, ByVal target As String) As String
. . .
Private Sub option3_Click()
' Save the text-content into a returning string
Text2.Text = GetPDFText(Text1.Text, 3, "")
End Sub
. . .
Comment and further question:
I am not used to VB but it seems to me that filename and target above are variables. If not I would like them to be so that I can substitute different file names from within the MS routine. Is that type of literal variable possible from within MS so that MS reads it as if it were the full path and file name as previously stored into the variable?
DLL use
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hi,
I don't think that DLL will work with Macro Scheduler because it returns a string, not a number. Are you able to email me a copy of that DLL, or tell me where I can download it? I could then test it and if necessary write you a DLL or ActiveX wrapper for it that will work in Macro Scheduler.
I don't think that DLL will work with Macro Scheduler because it returns a string, not a number. Are you able to email me a copy of that DLL, or tell me where I can download it? I could then test it and if necessary write you a DLL or ActiveX wrapper for it that will work in Macro Scheduler.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
The dll can be obtained from:
http://www.pdf-analyzer.com/
it is called pdftext
Thank you for offering to make it useable in MS.
http://www.pdf-analyzer.com/
it is called pdftext
Thank you for offering to make it useable in MS.
Robin
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hi,
Ok, it already works fine with Macro Scheduler since it offers an option to return the text to the clipboard or a file. So either way we have a method to put the returned text in a Macro Scheduler variable.
Using the clipboard:
//modify the next line to point to pdftext.dll
Let>lib=C:\Documents and Settings\Marcus\My Documents\pdftext\pdftext.dll
//modify the next line to point to a PDF file
Let>pdffile=C:\Documents and Settings\Marcus\My Documents\pdftext\pricing.pdf
//Call GetPDFText, passing the pdffile and putting result on clipboard
LibFunc>lib,GetPDFText,r,pdffile,2,
//Get text from the clipboard
GetClipBoard>thetext
MessageModal>thetext
Using a temporary text file:
//Using a text file
//modify the next line to point to pdftext.dll
Let>lib=C:\Documents and Settings\Marcus\My Documents\pdftext\pdftext.dll
//modify the next line to point to a PDF file
Let>pdffile=C:\Documents and Settings\Marcus\My Documents\pdftext\pricing.pdf
//Temp text file name
Let>tempfile=c:\pdftext.txt
//Call GetPDFText, passing the pdffile and putting result in tempfile
LibFunc>lib,GetPDFText,r,pdffile,1,tempfile
//Get text from tempfile
ReadFile>tempfile,thetext
MessageModal>thetext
//Delete tempfile
DeleteFile>tempfile
Ok, it already works fine with Macro Scheduler since it offers an option to return the text to the clipboard or a file. So either way we have a method to put the returned text in a Macro Scheduler variable.
Using the clipboard:
//modify the next line to point to pdftext.dll
Let>lib=C:\Documents and Settings\Marcus\My Documents\pdftext\pdftext.dll
//modify the next line to point to a PDF file
Let>pdffile=C:\Documents and Settings\Marcus\My Documents\pdftext\pricing.pdf
//Call GetPDFText, passing the pdffile and putting result on clipboard
LibFunc>lib,GetPDFText,r,pdffile,2,
//Get text from the clipboard
GetClipBoard>thetext
MessageModal>thetext
Using a temporary text file:
//Using a text file
//modify the next line to point to pdftext.dll
Let>lib=C:\Documents and Settings\Marcus\My Documents\pdftext\pdftext.dll
//modify the next line to point to a PDF file
Let>pdffile=C:\Documents and Settings\Marcus\My Documents\pdftext\pricing.pdf
//Temp text file name
Let>tempfile=c:\pdftext.txt
//Call GetPDFText, passing the pdffile and putting result in tempfile
LibFunc>lib,GetPDFText,r,pdffile,1,tempfile
//Get text from tempfile
ReadFile>tempfile,thetext
MessageModal>thetext
//Delete tempfile
DeleteFile>tempfile
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?