von Stephan » Sa, 09.11.2019 12:49
Wie würde das funktionieren?
z.B.:
Code: Alles auswählen
Sub Main()
Dim arg(0) as New com.sun.star.beans.PropertyValue
arg(0).Name = "Hidden"
arg(0).Value = True
dim args2(4) as new com.sun.star.beans.PropertyValue
args2(0).Name = "CharFontName.StyleName"
args2(0).Value = ""
args2(1).Name = "CharFontName.Pitch"
args2(1).Value = 0
args2(2).Name = "CharFontName.CharSet"
args2(2).Value = -1
args2(3).Name = "CharFontName.Family"
args2(3).Value = 5
args2(4).Name = "CharFontName.FamilyName"
args2(4).Value = "DejaVu Sans Mono"
x = Array("aa","bb","cc")
For i = 0 To Ubound(x())
k = k & x(i) & CHR(13)
Next i
x = StarDesktop.loadComponentFromURL ("private:factory/swriter","_blank", 0, arg())
x.Text.String = LEFT(k, LEN(k)-1)
ccf = x.CurrentController.Frame
With createUnoService("com.sun.star.frame.DispatchHelper")
.executeDispatch(ccf, ".uno:SelectAll", "", 0, Array())
.executeDispatch(ccf, ".uno:CharFontName", "", 0, args2())
.executeDispatch(ccf, ".uno:Copy", "", 0, Array())
End With
x.close(true)
End Sub
Mein Problem:
VBA-Code:
Code: Alles auswählen
la_ab(li_abzeile) = " | Rechnungsbetrag " & string(42," ") & "| " & ls_repr & " |"
Mein Problem ist, das er beim reinkopieren dieses Zwischenablagetextets in unterschiedliche Tools (Notepad, Thunderbird, hier in Forumbeitrag) die string(42," ") weglässt. CHR$(32) geht auch nicht. Nach Notepad klappts!
Ich habe keine Ahnung was Du damit meinst.
Gruß
Stephan
[quote]Wie würde das funktionieren?[/quote]
z.B.:
[code]Sub Main()
Dim arg(0) as New com.sun.star.beans.PropertyValue
arg(0).Name = "Hidden"
arg(0).Value = True
dim args2(4) as new com.sun.star.beans.PropertyValue
args2(0).Name = "CharFontName.StyleName"
args2(0).Value = ""
args2(1).Name = "CharFontName.Pitch"
args2(1).Value = 0
args2(2).Name = "CharFontName.CharSet"
args2(2).Value = -1
args2(3).Name = "CharFontName.Family"
args2(3).Value = 5
args2(4).Name = "CharFontName.FamilyName"
args2(4).Value = "DejaVu Sans Mono"
x = Array("aa","bb","cc")
For i = 0 To Ubound(x())
k = k & x(i) & CHR(13)
Next i
x = StarDesktop.loadComponentFromURL ("private:factory/swriter","_blank", 0, arg())
x.Text.String = LEFT(k, LEN(k)-1)
ccf = x.CurrentController.Frame
With createUnoService("com.sun.star.frame.DispatchHelper")
.executeDispatch(ccf, ".uno:SelectAll", "", 0, Array())
.executeDispatch(ccf, ".uno:CharFontName", "", 0, args2())
.executeDispatch(ccf, ".uno:Copy", "", 0, Array())
End With
x.close(true)
End Sub[/code]
[quote]Mein Problem:
VBA-Code:
Code: Alles auswählen
la_ab(li_abzeile) = " | Rechnungsbetrag " & string(42," ") & "| " & ls_repr & " |"
Mein Problem ist, das er beim reinkopieren dieses Zwischenablagetextets in unterschiedliche Tools (Notepad, Thunderbird, hier in Forumbeitrag) die string(42," ") weglässt. CHR$(32) geht auch nicht. Nach Notepad klappts!
[/quote]Ich habe keine Ahnung was Du damit meinst.
Gruß
Stephan