Lock fields to convert DOC to PDF

Creating a macro - Writing a Script - Using the API

Lock fields to convert DOC to PDF

Postby psun03 » Thu Mar 26, 2020 3:41 am

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   Expand viewCollapse view
    For Each oRange In oDoc.StoryRanges
            oRange.Fields.Locked = True

The code above looks through the Word document and locks fields. I am looking for code that will do similar but for OpenOffice.
OpenOffice 4.1.7 on Windows 10
Posts: 1
Joined: Thu Mar 26, 2020 3:33 am

Re: Lock fields to convert DOC to PDF

Postby JeJe » Thu Mar 26, 2020 1:21 pm

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.
Openoffice 4.1.2
Windows 8
Posts: 790
Joined: Wed Mar 09, 2016 2:40 pm

Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 1 guest