Set Userdata First and last name using macros in writer

Is there a way to set First and last name using macros by inserting them into inputBox and press ok to change the data of the image below

In microsoft office Word >> i use in VBA macros >> Application.UserName = inputBox(“please enter your name”,“Dear”)

is there a way to make code like this in libre office to set this data without opening the image below
thanks

I need to use word processor with Alfresco “CMS” , there are many users can access the file from the same machine and edit on it then i use to track their changes and preview it with who made the chnge,

so I need before the user start to edit in document to make method like login to verify who logged to the document

the user enter his name in input box ex: "John"
verify that his name in the database
change First and last name with his name, then if he made changes, it tells me that

There exist a macro “Userfields” in Gimmicks in LibreOffice Macros. It starts with “StartChangesUserfields”. “Save” seems not to work, but you can enter values into a field in a dialog and press “Select” to assign them; then Exit.

The macros there have not been maintained since OpenOffice.org, but they might give you an idea about how changing the fields might work.

Why do you need that? If it is about changing the user without changing the user on operating system level but only for LibreOffice, then a call with UserInstallation might work too. E.g.
D:\Apps\LO54x\program\soffice.exe -env:UserInstallation=file:///d:/Apps/LO54x_de_user
will call a LibreOffice installation, which is located in D:\Apps\LO54x\program\soffice.exe for a user, whose LibreOffice user profile is in folder d:/Apps/LO54x_de_user. (All on Windows 10)

Look at the Post-deployment configuration here.

Also:

https://wiki.openoffice.org/wiki/Documentation/Administration_Guide/LDAP_Access

when I try to change UserProfile property value using macros it gives me
ERROR
This Property is READ-ONLY

Are you answering me? My answer wasn’t about macros, or changing UserProfile property. (Why would you need to change it using macros? you cannot change path to configuration dynamically - you can only specify it at start time.)

Sorry,
But I need a way to use open office in “CMS”
there are many user can access it and making changes in the document
I want to record their changes by their names that stored in a database
so I want to make code like login form in the beginning of the document

Ex:

I create Document on my machine
You - as approver - try to open it to make some changes, Login form appear you enter “Mike”
the records saved as “Mike” insert “blablabla”

another one login as “JOHN”
record “JOHN” insert “a”