Writer, macro, sub, inputbox, print string

Hello!
I want a sub (macro) to print me string I put in the Inputbox.

Please, how do I write the sub code?

I tried:

sub y
string
Dim String1 as String
InputBox("Write the  string", "Box Tittle")
print Mystring
end sub

But it was not what I wanted. I want the macro to print in writer as normal text in writer the text I write in InputBox.

Please, all the advices would help!!!
I just want the string Mystring to be the string I input by InputBox, and nothing else, no icon- no box!!!

Many thanks!!!

p.s The task is that we INPUt a string and the macro outputs the string’s lenght

Why don’t you type your text directly to writer document?

HELLO, KAROLUS!
MANY THAKNS!!!
Please, is there any good link about this area? I am trying to google some, but as I am not english sepaking I am not sure I have chosen the right keywords!
many thanks!!!

libreoffice basic string length, libreoffice basic show message in a box