We have a doc file with a date macro. We are trying to convert it to a pdf using java , open office and JOD.
When the document is opened in word it has a warning , PROTECTED VIEW Be careful - files from the Internet contain viruses.Unless you need to edit, it's safer to stay in Protected View. Enable Editing(Button). In this mode the date is a previous value that was generated. As soon as I hit Enable Editing it changes todays value.
Now the challenge , when this doc in its original state is converted to a pdf using open office the date shown is todays date.
If the file is natively opened in libre office, libre office complains that it has macros and that they are disabled , and displays the todays date.
Ideally I want the date displayed in microsoft word to be shown when the pdf is created using libre. Is there anyway this can be achieved, is there a way for libre to not run that macro by setting some property value and using JOD.
Disable macro execution while converting to a pdf
Disable macro execution while converting to a pdf
Last edited by robleyd on Thu Apr 25, 2019 4:34 am, edited 1 time in total.
Reason: Remove known issue icon
Reason: Remove known issue icon
Libre Office 5.2.5
Windows
Windows
Re: Disable macro execution while converting to a pdf
Please upload a sample file here.
Your signature is:
Forum header - Use Control Panel - Profile )TAB) - Edit signature (subTAB)
Your signature is:
Please update your signature in this forumOpen Office 3.0
Windows
Forum header - Use Control Panel - Profile )TAB) - Edit signature (subTAB)
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.
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.
Re: Disable macro execution while converting to a pdf
1) If you are working with *.doc files you better use Microsoft products.
2) Do you know the difference between a date field and a fixed date field? The fixed one fixates the date when the file was stored for the first time. The shows the current date when the file was loaded.
2) Do you know the difference between a date field and a fixed date field? The fixed one fixates the date when the file was stored for the first time. The shows the current date when the file was loaded.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Disable macro execution while converting to a pdf
I cannot upload the sample file it contains sensitive data.
Libre Office 5.2.5
Windows
Windows
Re: Disable macro execution while converting to a pdf
Change the data so we can inspect the file.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Disable macro execution while converting to a pdf
Villeroy wrote:1) If you are working with *.doc files you better use Microsoft products.
2) Do you know the difference between a date field and a fixed date field? The fixed one fixates the date when the file was stored for the first time. The shows the current date when the file was loaded.
No I do not the difference between the two. Did you mean the latter shows the current date when the file is loaded?
Libre Office 5.2.5
Windows
Windows
Re: Disable macro execution while converting to a pdf
The fixed one shows the creation time. Typically it's used with letter templates. You create a new file and when you save it under some name the date is fixed until you save it under some other name. The other variant of date field always shows the current date.
https://support.office.com/en-us/articl ... ca9f3beed1
https://support.office.com/en-us/articl ... ca9f3beed1
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Disable macro execution while converting to a pdf
You can stop an individual macro running in various ways such
Insert the line "Exit sub" or "Exit function" eg
or comment out the lines in the macro (or even the whole macro) that you don't want to run by putting a ' at the start of each
Edit or you can use the exit sub or function with a condition. Something can be a boolean variable or anything else anywhere that resolves to true or false.
Insert the line "Exit sub" or "Exit function" eg
Code: Select all
sub changeDate()
exit sub
blah blah - won't run anymore
end sub
or
function changeDate()
exit function
blah blah - won't run anymore
end function
Code: Select all
sub changeDate()
'blah blah - won't run anymore
end sub
or comment out the whole function:
'function changeDate()
'blah blah
'end function
Code: Select all
dim something as boolean
function changeDate()
if something = true then exit function
blah blah - won't run anymore if something is true
end function
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)