CreateProperty, AppTitle, & AppIcon

  • Thread starter Thread starter beb
  • Start date Start date
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.
 
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
 
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
 
Back
Top