[Solved] Program to create CSV from PDF: User-defined type not defined

Talk about anything at all....
Post Reply
JayS
Posts: 2
Joined: Wed Oct 19, 2022 4:15 pm

[Solved] Program to create CSV from PDF: User-defined type not defined

Post by JayS »

 Edit: Split from Create CSV from Formdata of PDFs in a folder (using PDFtk) because the Code Snippets forum is not the right place to ask questions about how to use macros. 

Hey, hopefully this will get a reply. I have PDFtk server and toolkit installed, added the code here and ran the macro. I am getting an error
"Compile Error - User defined type not defined"
I am at a block here. I cant see anything in the below to change

Function MakePropertyValue(Optional cName As String, Optional uValue) As com.sun.star.beans.PropertyValue

All I need is the page numbers from the list. Hopefully there is something I can alter to make this work.

Any help is appriciated - Jay
Attachments
Screenshot 2022-10-19 151836.png
Screenshot 2022-10-19 151836.png (27.32 KiB) Viewed 5314 times
Last edited by Hagar Delest on Fri Oct 21, 2022 10:19 am, edited 4 times in total.
Reason: tagged solved.
Windows 10 - No Open Office (Office 365)
User avatar
Zizi64
Volunteer
Posts: 11364
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Create CSV from Formdata of PDFs in a folder (using PDFtk)

Post by Zizi64 »

Microsoft Visual Basic for Applications?????????????????

How it is related to the StarBasic + AOO/LO API based macro code???
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Create CSV from Formdata of PDFs in a folder (using PDFtk)

Post by John_Ha »

Macros are not compiled.

1. Place the macro as described in musikai's post - eg in Tools > Macros > Organise Macros > OpenOffice Basic > My Macros > Standard > Module 1.

2. Run the macro by going to Tools > Macros > Organise Macros > OpenOffice Basic > My Macros > Standard > Module 1 and running Folder_of_PDFs_to_CSV.

It should run.

Read the book "Macros Explained" at http://www.pitonyak.org/oo.php for more information or see the User Guides or read Help.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Mountaineer
Posts: 318
Joined: Sun Sep 06, 2020 8:27 am

Re: Create CSV from Formdata of PDFs in a folder (using PDFtk)

Post by Mountaineer »

John_Ha wrote: Wed Oct 19, 2022 6:11 pm ...
1. Place the macro as described in musikai's post - eg in Tools > Macros > Organise Macros > OpenOffice Basic > My Macros > Standard > Module 1.
...
I guess he can't, because his signature says he is using Office365.
As M$ don't know UNO the code stumbles at the first type from UNO-libs.

Using Macros from OpenOffice/UNO in VBA is even more comlicated as the other way round, as I assume there is no flag to switch uno-library-compatibility.

So before 1) he needs 0) to install either OpenOffice or LibreOffice, or he has to rewrite the code in VBA.

J.
OpenOffice 3.1 on Windows Vista
User avatar
Hagar Delest
Moderator
Posts: 32668
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Program to create CSV from PDF says: User-defined type not defined

Post by Hagar Delest »

Topic moved to the General discussion section. To avoid confusion with AOO related questions.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
JayS
Posts: 2
Joined: Wed Oct 19, 2022 4:15 pm

Re: Program to create CSV from PDF says: User-defined type not defined

Post by JayS »

Thank you for the replies all. Very silly of me here, yes I was using 365 so that's probably why this wasn't working. I did find TTFA PDF Page Counter in the meantime which was exactly what I needed so thank you for your help here
Windows 10 - No Open Office (Office 365)
Post Reply