Ask Your Question
0

macro to change the background image of a database form

asked 2015-05-14 15:49:14 +0100

jay Arr gravatar image

I have need of a macro to change the background image of a database form.

The current image and the changed-to-image are imported, linked to, bitmaps so I'm assuming that the macro will need to reset the current URL of the image.

But I'm stuck on how to do it.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2015-05-14 20:01:39 +0100

pierre-yves samyn gravatar image

Hi

A database form is a text document (supports com.sun.star.text.TextDocument service). So you can do something like that:

LibOForm = ThisDatabaseDocument.FormDocuments.getByName("FormName").open 

sUrl = convertToUrl("C:\Users\UserName\Pictures\Foo.JPG")

oStyles = LibOform.styleFamilies.getByName("PageStyles")
oStyle = oStyles.getByName("Standard")
oStyle.BackGraphicURL = sUrl
edit flag offensive delete link more
0

answered 2015-05-15 08:45:20 +0100

jay Arr gravatar image

Thank you again Pierre for a simple, understandable, succinct answer.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-05-14 15:49:14 +0100

Seen: 178 times

Last updated: May 15 '15