Ask Your Question

macro to change the background image of a database form [closed]

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 reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-08-21 12:39:42.687665

2 Answers

Sort by » oldest newest most voted

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

pierre-yves samyn gravatar image


A database form is a text document (supports 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

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

Question Tools

1 follower


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

Seen: 209 times

Last updated: May 15 '15