CreateProperty, AppTitle, & AppIcon

B

beb

Does anyone know the VBA code to set the AppTitle and
AppIcon properties?

Basically, I would like the AppTitle to be updated
everyday, so I would need to have some code that runs
everyday when the user starts the application.
 
A

Allen Browne

This kind of thing should do it:

Dim db As DAO.Database
Set db = dbEngine(0)(0)
db.Properties("AppIcon") = "C:\MyIcon.ico"
db.Properties("AppTitle") = "Started at " & Now()
Application.RefreshTitleBar
 
M

Marshall Barton

beb said:
Does anyone know the VBA code to set the AppTitle and
AppIcon properties?

Basically, I would like the AppTitle to be updated
everyday, so I would need to have some code that runs
everyday when the user starts the application.


Here's an example:

Sub SetAppIcon()
Dim prp As Property

On Error Resume Next

With DBEngine(0)(0).Containers!Databases.Documents!MSysDb
.Properties("AppIcon") = "D:\path\file.ICO"
If Error.number = 3270 Then
Set prp = .CreateProperty("AppIcon", _
dbText,"D:\path\file.ICO")
.Properties.Append prp
Set prp = Nothing
End If
.Properties("AppTitle") = "Test App Title"
If Error.number = 3270 Then
Set prp = .CreateProperty("AppTitle", dbText, "Test
App Title")
.Properties.Append prp
Set prp = Nothing
End If
RefreshTitleBar
End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top