[Solved] Two Styles on the same line

Discuss the word processor
Post Reply
ScoobyAalo
Posts: 9
Joined: Tue Apr 09, 2019 8:45 am

[Solved] Two Styles on the same line

Post by ScoobyAalo »

Hi,

I have a bunch of documents(Swedish) in ODT-format that I distribrute to others and they use it as
base for composing letters.

At the start of the document, not in the header of page, there are a couple of lines with headers.
I present it as I want it to look when text is filled in by the others. When i distribute the documents there is
no text after the colon character.

Errandnumber: 123456
Name: Peter Parker
Phonenumber: 070-12345678


When the others fill in this part of the document the Style is remembered, in this case Bold, and
continues to write characters with this style

Errandnumber: 123456
Name: Peter Parker
Phonenumber: 070-12345678

I would like something like a styleseparator as in MS Word. I've tried with character styles but couldnt get it to work
the way I wanted it.
The only way I found is to make it a table with diffenrent styles in different cells.

As these documents are used by older people that are not used to computers I am after an easy solution without macros, templates
and such.

Is there another way to do this?

Thankful for any comments
Last edited by Hagar Delest on Mon Oct 30, 2023 11:33 am, edited 1 time in total.
Reason: tagged solved
LibreOffice 7.5.7.1, Win7
User avatar
Lupp
Volunteer
Posts: 3562
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Two Styles on the same line

Post by Lupp »

(Assuming LTR writing direction, no explicit Char-settings in advance of typing.)
If you type a piece of text anywhere, or append it at the end of a paragraph, or overwrite a selected portion, the characters of this piece always get assigned the attributes (including the CharStyle name) taken from the character left of the insertion position. In case of an empty paragraph the character properties set for the paragraph are assumed.
This also holds if you Ctrl+Shift+V something in Unformatted text mode, and if you use the method insertString by user code.

Thus:
Append behind the colon a space (or a tab or some different whitespace?) formatted the way you want to be applied to the added text.
Tell users they must not delete it.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
ScoobyAalo
Posts: 9
Joined: Tue Apr 09, 2019 8:45 am

Re: Two Styles on the same line

Post by ScoobyAalo »

Thank you,

I tried that but the users manage to mess up anyway and delete the whitespace.

Maybe I cannot make this as foolproof as I want it but now I found the feature
from menu Table->Convert->Text to Table and assign it to a shortcut it's pretty
quick to insert a table for each row and have different paragraphs in each cell.

This way I get no problems with text alignment. When I contructed the tables manually
The text was not aligned beween cells or to much space between rows and required
a lot of fiddling to look as before.

Now I need to research if I can lock the table cells as not to allow users to edit them :D
Last edited by ScoobyAalo on Fri Oct 20, 2023 2:10 pm, edited 3 times in total.
LibreOffice 7.5.7.1, Win7
ScoobyAalo
Posts: 9
Joined: Tue Apr 09, 2019 8:45 am

Re: Two Styles on the same line

Post by ScoobyAalo »

T'was easy to lock a cell by placing cursor in that cell
and choose menu Table-->Protect Cell

Now I want to lock/disable resizing of the table i.e. to not let the user
drag and resize the column width.

I am not sure this is possible?
LibreOffice 7.5.7.1, Win7
ScoobyAalo
Posts: 9
Joined: Tue Apr 09, 2019 8:45 am

Re: Two Styles on the same line

Post by ScoobyAalo »

As far as I have found out there is currently no way to lock the resizing
of columns.

I found this
https://design.blog.documentfoundation. ... ce-writer/
which is a discussion on a future possible dialog layout where you
can lock column widths

Have I missed a way to protect resizing of column widths?
LibreOffice 7.5.7.1, Win7
User avatar
Lupp
Volunteer
Posts: 3562
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Two Styles on the same line

Post by Lupp »

Why does it seem to be necessary to make things "foolproof" everywhere nowadays?

Where you really need to get things foolproof on a professional level, you do use thoroughly designed databases and professionally designed enduser forms.

(Well, my bank also fails with it currently. Are there still professionals?)
Fools are much too inventive to be discouraged by ordinary "foolproofness"!
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
Posts: 3562
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Two Styles on the same line

Post by Lupp »

ScoobyAalo wrote: Fri Oct 20, 2023 2:30 pm As far as I have found out there is currently no way to lock the resizing
of columns.
TextTable objects are a crutch. They simply aren't made for the kind of task, imo.

What might best suit your intentions, without the need to develop a database, could perhaps be a spreadsheet application. Textual parts requiring special attributing or "prettyview/prettyprint" appearance can there be inserted as OLE objects e.g. In addition some basic functionality of DB can be implemented with the help of FormControl objects in sheets.

Of course, this would still require to transfer everything manually (or based on user code) to the actual data-keeping target file.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
JeJe
Volunteer
Posts: 2841
Joined: Wed Mar 09, 2016 2:40 pm

Re: Two Styles on the same line

Post by JeJe »

Normally you would use a form textbox for user input like this.

Alternatively though you could use a form control label for text frame or drawing textbox for the label instead as in the attached document.

Note: form control labels don't always redraw properly in OO.
Attachments
labels or frames.odt
(13.91 KiB) Downloaded 255 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
JeJe
Volunteer
Posts: 2841
Joined: Wed Mar 09, 2016 2:40 pm

Re: Two Styles on the same line

Post by JeJe »

In the attached, I've changed the anchoring of the drawing textboxes to page and adjusted the left paragraph indent to their width to make space for each of them. They then can't be inadvertently deleted when editing the document text.

This has to be done once everthing before it in the document has been finalised or changes could mess it up by moving those paragraphs with the appropriate indents.


Edit:
You can do the same thing without indenting paragraphs by changing the wrap to After but I get problems with the textboxes need not to be vertically overlapping or this won't work properly. As you want bold in those they have a greater height than the non-bold text to be added The textboxes have a bigger height because of the border, so paragraph height has to be increased such as by adding space after - which becomes a faff on and the advantage of just using wrap is lost unless you want all your paragraphs to have that extra space.
Attachments
labels or frames2.odt
(14.43 KiB) Downloaded 252 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
JeJe
Volunteer
Posts: 2841
Joined: Wed Mar 09, 2016 2:40 pm

Re: Two Styles on the same line

Post by JeJe »

setting "fixed height to text" unticked for the textbox text, solves above mentioned problem.
Attachments
labels or frames3.odt
(15.1 KiB) Downloaded 256 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
erbsenzahl
Volunteer
Posts: 256
Joined: Tue Apr 18, 2017 8:23 am
Location: Germany

Re: Two Styles on the same line

Post by erbsenzahl »

I often used protected sections for fillable forms (form controls).
To copy a protected section you have to additonally select the guiding and the trailing paragraph (outside the section).


Check my sample file.
 
 
FoolproofForms.odt
(13.2 KiB) Downloaded 403 times
LibreOffice current versions 7.x & 24.x and OpenOffice 4.1.15
on LinuxMint 20 - 21 Mate, W10-64 pro
ScoobyAalo
Posts: 9
Joined: Tue Apr 09, 2019 8:45 am

Re: Two Styles on the same line

Post by ScoobyAalo »

Thank you everybody for thoughts and comments. :bravo:

I am a little swamped right now but maybe at the
end of the week I can find some time to experiment.
LibreOffice 7.5.7.1, Win7
ScoobyAalo
Posts: 9
Joined: Tue Apr 09, 2019 8:45 am

Re: Two Styles on the same line

Post by ScoobyAalo »

I have checked out your sample files that you so kindly provided and played around with them a bit.

For me I liked the solution with tables where you lock the first cell the most.
Looks good and its quick an dirty to apply.

Now I will release it into the wild and see how it holds up when the users gets a hold of them.

Thanks for comments.
LibreOffice 7.5.7.1, Win7
Post Reply