Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Dynamic Contact Information in a Letterhead

Hello everyone!

My name is Keith Howard.

Tech info: OS: WinXp Sp3 LO Ver: 4.0.4.2

Let me, first, attempt to explain what I want to accomplish.

As the subject of this post implies, I have a letterhead (writer document) with contact information in the header. I want to dynamically update the contact information from a database (LDAP technically, but I have that part setup). I have the connection setup, and I have a query that limits the row to one. The query is such that it limits by Job Title. So, if I want a letterhead for the manager, I setup the query and link it to this letterhead. If the manager is replaced (or name changes), I want the information to be reflected, DYNAMICALLY (read, no user interaction).

I've tried mail merge fields, but pressing F9 does nothing and the user would have to go through the mail merge wizard.

I've, also, tried F4-select the row-then press (Data to Fields) button in the toolbar.

This works great, but I would like to automate this with a macro, as it is too many steps for the user.

So, my question(s) is/are, am I going about this the right way by using Mail Merge fields or is there a different/better/easier way?

If Mail Merge fields are the best way to go, how can I create a macro that emulates pressing F4, selecting the one row and then pressing 'Data to Fields'?

I've, also, tried this StarBasic command in a macro without success (it may not exist?):

dispatcher.executeDispatch(document, ".uno:DataToFields", "", 0, Array())

Thanks!

Keith

Dynamic Contact Information in a Letterhead

Hello everyone!

My name is Keith Howard.

Tech info: OS: WinXp Sp3 LO Ver: 4.0.4.2

Let me, first, attempt to explain what I want to accomplish.

As the subject of this post implies, I have a letterhead (writer document) with contact information in the header. I want to dynamically update the contact information from a database (LDAP technically, but I have that part setup). I have the connection setup, and I have a query that limits the row to one. The query is such that it limits by Job Title. So, if I want a letterhead for the manager, I setup the query and link it to this letterhead. If the manager is replaced (or name changes), I want the information to be reflected, DYNAMICALLY (read, no user interaction).

I've tried mail merge fields, but pressing F9 does nothing and the user would have to go through the mail merge wizard.

I've, also, tried F4-select the row-then press (Data to Fields) button in the toolbar.

This works great, but I would like to automate this with a macro, as it is too many steps for the user.

So, my question(s) is/are, am I going about this the right way by using Mail Merge fields or is there a different/better/easier way?

If Mail Merge fields are the best way to go, how can I create a macro that emulates pressing F4, selecting the one row and then pressing 'Data to Fields'?

I've, also, tried this StarBasic command in a macro without success (it may not exist?):

dispatcher.executeDispatch(document, ".uno:DataToFields", "", 0, Array())

Thanks!

Keith