I am doctor (X-ray). Asking my friend to create text macros for me to write protocols faster. I just wanted to push ALT+Q (or another letter). Then push ALT+number (from 0 to 9). For each ALT+number I insert prepared text. It is work. Part of inserted text should be bold. I insert text, then select 2-3 words and press Ctrl+B. But I wanted to customised macro.
I need: vvod(0).Value = //bold "Вариант строения bold// — // regular один корень, один канал. regular//"
I tried to figure it out on my own, but I can't, because I'm a piece of shit. Can someone tell me in which direction to think, because I'm stuck?
I am attaching part of the code.
enter code here
REM ***** BASIC *****
GLOBAL number as Integer
GLOBAL vid as Integer
public Sub Main
End Sub
public Sub ALTQ
vid = 1
End Sub
public Sub ALTW
vid = 2
End Sub
public Sub ALTE
vid = 3
End Sub
public sub ALT1
number = 1
solve()
end sub
public sub ALT2
number = 2
solve()
end sub
public sub ALT3
number = 3
solve()
end sub
public sub solve
rem —-----------------------------------------------------------------------------------—
rem Определение переменных и получение доступа к ним, не трогай
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem —---------------------------------------------------------—
rem определение переменных, которые ты сам будешь создавать и использовать
dim vvod(0) as new com.sun.star.beans.PropertyValue
rem Name обязательно равняется ТЕКСТ
vvod(0).Name = "Text"
rem —------------------------------------------------------------------------------------—
if vid = 1 Then
if number = 1 Then
vvod(0).Value = "коронковая часть реставрирована. "
elseif number = 2 Then
vvod(0).Value = "коронковая часть реставрирована пломбами. "
elseif number = 3 Then
vvod(0).Value = "депульпирован. Коронковая часть реставрирована. "
End if
I tried to figure it out myself and this is what I came up with:
1)
Dim sVar As String
sVar = "Это тест"
sVar.CharWeight = com.sun.star.awt.FontWeight.BOLD
error
2)
Dim TextX As Object
TextX.String = "Это тест"
RectangleShape.CharWeight = com.sun.star.awt.FontWeight.BOLD
vvod(0).Value = TextX
error
I will be very grateful if you help me.