Lock fields to convert DOC to PDF

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
psun03
Posts: 1
Joined: Thu Mar 26, 2020 3:33 am

Lock fields to convert DOC to PDF

Post by psun03 »

I am writing a Basic Macro that will open a WORD file and save it as PDF. The WORD doc converts just fine, except some of the documents have fields in them. I have written something in with the OFFICE Word macro, but I am new to the OpenOffice Macro world.

in my original MS Word macro I have this statement

Code: Select all

    For Each oRange In oDoc.StoryRanges
            oRange.Fields.Locked = True
        Next
The code above looks through the Word document and locks fields. I am looking for code that will do similar but for OpenOffice.
Thankss
OpenOffice 4.1.7 on Windows 10
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Lock fields to convert DOC to PDF

Post by JeJe »

OpenOffice Writer doesn't appear to have the equivalent of locking fields. There is thiscomponent.lockcontrollers/thiscomponent.unlockcontrollers which is similar to stopping application.screenupdating in VBA.

If you say more about what the problem is with the converting with the fields - maybe someone can provide a solution. Perhaps post an example document.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply