[Solved] Editing the author's name of a document

Discuss the word processor
Post Reply
nunof32
Posts: 59
Joined: Sat Jul 28, 2012 9:52 am

[Solved] Editing the author's name of a document

Post by nunof32 »

Hello,

Some help here would be welcome.

When a document is first created it gets attached to it the name of the author (as specified in OpenOffice>Preferences>OpenOffice>UserData). You can check this in File>Properties...>General

My question : is there a way to modify this piece of data on an existing document ? To say for instance that the author was not John but Bill.

I have already tried to change the data in OpenOffice>Preferences>OpenOffice>UserData and then create a copy of the document (Duplicate, Save As ...) but the original author's name is still what appears in the copied document.

Thanks in advance.
Last edited by Hagar Delest on Mon Nov 02, 2020 11:05 pm, edited 1 time in total.
Reason: tagged solved
OpenOffice 4.1.10 with MacOS X 10.13.6
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Editing the author's name of a document

Post by RusselB »

I believe the only way to do this is to create the document after signing in on the computer using a different profile.
On a Windows system (I don't have a Mac), the User Profile is specific to the user that is signed in.
If you're looking for a way to change this after the fact, you might be able to do it using the OS properties window.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
nunof32
Posts: 59
Joined: Sat Jul 28, 2012 9:52 am

Re: Editing the author's name of a document

Post by nunof32 »

Thanks.

May be there is a way to do it programmatically (I was trying to avoid to embark on that :) ).
OpenOffice 4.1.10 with MacOS X 10.13.6
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Editing the author's name of a document

Post by RoryOF »

In /Tools /Options /OpenOffice /User Data (Options is under Preferences on a Mac) enter the desired name in First/Last Name; any new document created will now use that name as Author.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
nunof32
Posts: 59
Joined: Sat Jul 28, 2012 9:52 am

Re: Editing the author's name of a document

Post by nunof32 »

Thanks again.

If you need to change a document's Properties Attributes after it has been created I believe you must do it programmatically :

Code: Select all

sub docPropertiesChange

REM This routine sets a new value for the Author attribute of a document's properties

dim docProps as object

Doc = ThisComponent

docProps = Doc.DocumentProperties

docProps.Author = "NewAuthor"

end sub
Please refer to the API, there are a lot more attributes that you can get and set this way.

Regards,

nunof32
Last edited by RoryOF on Mon Nov 02, 2020 5:26 pm, edited 1 time in total.
Reason: Added [code] tags [RoryOF, Moderator]
OpenOffice 4.1.10 with MacOS X 10.13.6
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: Editing the author's name of a document

Post by Bill »

I was able to change the author's name by opening a test ODT file with an archive manager, then opening the meta.xml file. The original author's name is in the <meta:initial-creator> element. The name of the person who made the last modification is in the <dc:creator> element. After changing both names in meta.xml and saving the changes, the new names showed up in the ODT file when it was reopened.
AOO 4.1.14 on Ubuntu MATE 22.04
nunof32
Posts: 59
Joined: Sat Jul 28, 2012 9:52 am

Re: [Solved] Editing the author's name of a document

Post by nunof32 »

Hi Bill,

Good suggestion, it's a much more practical way then mine (macro) to make the change.
However, I tried that and it does not work for me. Edited the meta.xml file and saved the changes. Reopened the ODT file and it still shows the original name not the modified one. Do you have an idea what step I could be missing ?
Thanks.
OpenOffice 4.1.10 with MacOS X 10.13.6
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Editing the author's name of a document

Post by RoryOF »

I have just checked, modifying a file as Bill suggested by editing the meta.xml; this worked correctly. I edited meta.xml using an XML editor; when I told it to save the changes, it prompted for permission to overwrite meta.xml in the OO .odt file, which I let it do.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
nunof32
Posts: 59
Joined: Sat Jul 28, 2012 9:52 am

Re: [Solved] Editing the author's name of a document

Post by nunof32 »

Thanks all.

Obviously, my un-familiarity with this kind of things is leading me to make some stupid thing that makes that Bill's suggestion does not work for me.
Just in case another un-expert will read this post in the future, here is what I am doing (and is obviously incorrect) :
1. With an archive manager extract the XML files that make up your .odt file. You get a folder with all the components
2. Locate the meta.xml file
2. With an XML Editor, open and type a new value in the initial-creator field of the meta.xml file
3. Save the changes

At this point there is no overwrite permission request that is issued as RoryOF indicates. The meta.xml file I edited is however actually modified (as I can see if I open it again). But that has no effect whatsoever on the original .odt file. I am obviously not touching the right meta.xml file. Or, as I said, doing some other stupid thing.

Good luck to all and many thanks again.

Regards,

nunof32
OpenOffice 4.1.10 with MacOS X 10.13.6
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Editing the author's name of a document

Post by Villeroy »

Some editors can edit files directly from within archives so you don't need to extract the files to be edited. You extracted the xml. Just save the extracted xml and then put it into the archive (.odt or .zip) overwriting the one that is still unmodified in there.
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
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Editing the author's name of a document

Post by RoryOF »

The overwrite permission request may differ according to the method of opening the archive file and editing the XML.

I find two entries in meta.xml: the first is <meta:initial-creator> which is the author of the file, the second is a little further down, <dc:creator> which records a subsequent modifier of the file. I have now re-edited meta.xml changed creation and modification dates (to ridiculous values); these now show up in the /File /Properties : General tab of the modified file, complete with the changed author and the changed modifier of the file.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
MrProgrammer
Moderator
Posts: 4907
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] Editing the author's name of a document

Post by MrProgrammer »

nunof32 wrote:When a document is first created it gets attached to it the name of the author (as specified in OpenOffice>Preferences>OpenOffice>UserData). You can check this in File>Properties...>General. My question : is there a way to modify this piece of data on an existing document ? To say for instance that the author was not John but Bill.
nunof32 wrote:The meta.xml file I edited is however actually modified (as I can see if I open it again). But that has no effect whatsoever on the original .odt file. I am obviously not touching the right meta.xml file. Or, as I said, doing some other stupid thing.
This is a non-technical method of making the change. It does not require manual adjustments to meta.xml. It's simple and probably faster than using ZIP archives and XML editing tools, even for people quite familar with them. Options are set with OpenOffice → Preferences on a Mac, Tools → Options on other platforms.
• Set the desired new author in option OpenOffice → User Data
• Set option OpenOffice → Security → Options → Remove personal information on saving → OK → OK
• Open the document, make a trivial change like adding a space to File → Properties → Description
• Save the document; this removes the author which used to be in the document
• Unset option OpenOffice → Security → Options → Remove personal information on saving → OK → OK
• Open the document, make a trivial change like removing the added space in File → Properties → Description
• Save the document; this sets the new author
• Change option OpenOffice → User Data back to the original value

On a Mac, potentially you could use the Guest User for this work, avoiding altering your own User Data.
Q28: How do I use the Guest User account to run a test?
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: [Solved] Editing the author's name of a document

Post by Bill »

nunof32 wrote:Thanks all.

Obviously, my un-familiarity with this kind of things is leading me to make some stupid thing that makes that Bill's suggestion does not work for me.
Just in case another un-expert will read this post in the future, here is what I am doing (and is obviously incorrect) :
1. With an archive manager extract the XML files that make up your .odt file. You get a folder with all the components
2. Locate the meta.xml file
2. With an XML Editor, open and type a new value in the initial-creator field of the meta.xml file
3. Save the changes

At this point there is no overwrite permission request that is issued as RoryOF indicates. The meta.xml file I edited is however actually modified (as I can see if I open it again). But that has no effect whatsoever on the original .odt file. I am obviously not touching the right meta.xml file. Or, as I said, doing some other stupid thing.
RoryOF was asked for overwrite permission because he opened the meta.xml file directly from the archive manager window. You weren't asked for permission because you extracted the meta.xml file and edited the extracted file.

Since you did not open the meta.xml file directly from the archive manager, after step 3 you have to drag the modified meta.xml file back into the archive manager window to replace the unmodified meta.xml file. Did you do that?
AOO 4.1.14 on Ubuntu MATE 22.04
nunof32
Posts: 59
Joined: Sat Jul 28, 2012 9:52 am

Re: [Solved] Editing the author's name of a document

Post by nunof32 »

Now, I have done that. And it worked.

Thanks Bill
OpenOffice 4.1.10 with MacOS X 10.13.6
justincase
Posts: 1
Joined: Tue Mar 08, 2022 5:44 am

Re: [Solved] Editing the author's name of a document

Post by justincase »

Thanks for the information above, it worked for me.

Here are more detailed instructions:
1. Install the cross-platform archiver program 7-Zip from here: https://www.7-zip.org/download.html
2. Right click on your .odt file and move your mouse down to 7-Zip and across to Open archive and click on it
3. Right click on meta.xml and click on Edit
4. Look for <meta:initial-creator> tag and edit the name between it and the </meta:initial-creator> tag
5. Click the File menu and then click Save
6. Close Notepad
7. A popup will display this message:
"File 'meta.xml' was modified.
Do you want to update it in the archive?"
click the OK button
8. Close off 7-Zip
Apache OpenOffice 4.1.8 running on Windows 10 Home 21H2 19044.1526
Post Reply