Pergunte aqui

Perfil de Ulli_Wue - atividade

2017-12-18 10:26:14 +0200 Medalha recebida  Pergunta famosa (fonte)
2017-12-11 07:25:22 +0200 Medalha recebida  Estudante (fonte)
2017-08-28 12:30:14 +0200 Medalha recebida  Pergunta famosa (fonte)
2017-06-24 07:42:46 +0200 Medalha recebida  Pergunta famosa (fonte)
2017-06-23 02:09:43 +0200 Medalha recebida  Pergunta notável (fonte)
2017-06-04 21:20:54 +0200 Medalha recebida  Pergunta famosa (fonte)
2017-04-25 02:03:45 +0200 Medalha recebida  Pergunta popular (fonte)
2017-04-25 02:03:45 +0200 Medalha recebida  Pergunta notável (fonte)
2017-03-01 08:57:52 +0200 Medalha recebida  Pergunta famosa (fonte)
2016-09-27 15:13:44 +0200 Medalha recebida  Pergunta popular (fonte)
2016-09-10 13:20:25 +0200 Pergunta comentada How can I write a macro to assign a shortcut to another macro?

JohnSun, thank you, I read it, hmmmm, still no improvement ...

Some years ago I wrote in VBA this to assign my macros to a shortcut list

Sub AssignShortCuts()
m = Array("macro1", "macro2", "macro3")
s = Array("a", "b", "c")
With Application
For i = 0 To UBound(m)
.MacroOptions Macro:=m(i), HasShortcutKey:=True, ShortcutKey:=si)
Next
End With
End Sub

2016-09-10 11:55:35 +0200 Perguntou How can I write a macro to assign a shortcut to another macro?

I'm wondering if it is possible to create a macro which itself assigns a list of existing macros to another existing lists of shortscuts? Macro recorder was no help. I know how to bind a macro to a shortcut over the menue: Tools --> Customize --> Keyboard .... But writing a macro for this task, I even don't know where to start .... Any ideas?

2016-09-10 11:41:43 +0200 Resposta comentada Create macro to insert and link a OLE Spreadsheet?

Thank you for your answer, this took me a huge step forward, still searching how to manipulate or create a link using dbg_properties and / or dbg_methods ...

2016-09-10 11:36:25 +0200 Medalha recebida  Acadêmico (fonte)
2016-09-10 04:19:17 +0200 Medalha recebida  Pergunta notável (fonte)
2016-09-08 14:40:37 +0200 Medalha recebida  Pergunta popular (fonte)
2016-09-07 13:37:18 +0200 Resposta comentada Insert an external link to a html file in Writer

Kruno, where do I set a mark "question answered"?

2016-09-07 11:39:06 +0200 Perguntou Create macro to insert and link a OLE Spreadsheet?

Hi,

does anyone know how to build a macro that basically does this (see menue)

Insert -> Object -> OLE-Object -> Create from file (e.g. filename of Calc-table) & Link to file = yes

I tried the macro recorder, however, without any success and searched for macro snippets in a lot of places. I would like to insert a large amount of tables into a document and create a link to those tables, later update those links in case of changes.
Any ideas?

Ulli

2016-09-07 11:29:42 +0200 Medalha recebida  Entusiasta
2016-09-02 11:16:52 +0200 Medalha recebida  Editor (fonte)
2016-09-02 11:16:01 +0200 Perguntou Macro to insert an OLE object with a link to a spreadsheet table

Hi,

does anyone know how to build a macro which inserts an OLE link to a spreadsheet?
I know how to embed an object and how to modify it (see macro example below), but couldn't find a way to create a link to that object by macro. Basically the macro should do what is done by menue with
Insert -> Object -> OLE-Object -> Create from file (now give the filename of Calc-table) & Link to file = yes
Of course, I tried the macro recorder, without success.
Next thing I did: I was snooping through properties of an embedded object, again, without sucess.
e.g. with msgbox ThisComponent.getEmbeddedObjects().getByIndex(0).getEmbeddedObject().dbg_properties

Any ideas, comments or suggestions are highly appreciated.

Best wishes.

Ulli

sub oleexample
oDoc = ThisComponent
txt=oDoc.getText
Set TextCursor = txt.createTextCursor
Set TextEmbeddedObject = oDoc.createInstance("com.sun.star.text.TextEmbeddedObject")
Dim asize As New com.sun.star.awt.Size
asize.Height =10000
asize.Width = 10000
TextEmbeddedObject.CLSID = "47BBB4CB-CE4C-4E80-a591-42d9ae74950f"
txt.insertTextContent TextCursor, TextEmbeddedObject, False
TextEmbeddedObject.setSize asize
Set SpreadSheetDoc = TextEmbeddedObject.getEmbeddedObject
oSheets=SpreadSheetDoc.getSheets
oSheet = oSheets.getByIndex(0)
oCell = oSheet.getCellByPosition(0, 0)
oCell.setString "ABCD"
end sub

2016-09-02 10:13:34 +0200 Resposta comentada Insert an external link to a html file in Writer

Ok. Got it. Works like a charm. Thank you!

2016-09-01 10:55:11 +0200 Medalha recebida  Pergunta notável (fonte)
2016-08-31 15:08:30 +0200 Medalha recebida  Pergunta popular (fonte)
2016-08-31 13:18:38 +0200 Resposta comentada Insert an external link to a html file in Writer

Seems OK, table shows up, but in the header, doesn't seem to move if text moves down, strange.... Hmmmm, let me think about it....

2016-08-31 10:57:29 +0200 Perguntou Insert an external link to a html file in Writer

Hi, I'd like to know how to insert a link to html in writer. Suppose I have a html file (say table.html). Now, how is it possible to link to this file in a writer document. I see, it is possible to dynamically link to Images. I tried OLE (no success), DDE (no success), searched for user-defined fields (no sucess). Is there an equivalent of dynamically linking to an external html file in Writer? Any idea is appreciated.

Ulrich

2016-03-09 21:08:56 +0200 Medalha recebida  Pergunta famosa (fonte)
2015-12-27 23:35:13 +0200 Medalha recebida  Pergunta notável (fonte)
2015-12-27 17:18:23 +0200 Medalha recebida  Pergunta popular (fonte)
2015-12-22 17:26:56 +0200 Medalha recebida  Pergunta notável (fonte)
2015-12-22 16:26:31 +0200 Perguntou How to break a for loop

Hi there,

I'm wondering if it is possible to break a simple loop based on for-next (see example below). How can this loop be stopped? Obviously, Ctrl + Break oder Ctrl + c is not working for me. Any idea or hint is appreacheated.

Best wishes Ulli

sub how_to_break_a_for_loop
    for i = 1 to 100
        msgbox "this is " & i
    next    
end sub
2015-12-22 16:26:19 +0200 Respondeu uma pergunta How to cylce through selected spreadsheets?

This is perfect! Works great. Thank you very much. Big respect and best wishes. Ulli

2015-12-21 23:03:12 +0200 Medalha recebida  Pergunta popular (fonte)
2015-12-21 13:56:41 +0200 Perguntou How to cylce through selected spreadsheets?

I'm trying to cycle through spredsheets using basic. I found the code-snippet below. But how can I cycle through those sheets which are alread selected (e.g. multiple selection, but not those which are unselected)? I found the object SelectedSheetsEnum, but how can I use it? Any ideas?

Best wishes

Ulli

sheets = Thiscomponent.getSheets.createEnumeration 
While sheets.hasMoreElements
    oSheet = sheets.nextElement()
    MsgBox "Next sheet name is " & oSheet.getName
Wend