我正在Access中开发一个应用程序。我想做的是能够编写已部署版本的脚本。
为此,我想:
这就是我目前的情况,这是可怜的,因为我使用sendkeys两次。但是,我能够做到3/4。
Public Sub MakeDeployable()
'how can I do this? All examples seem to use
'Me.RibbonName which sets it for a form, not globally
'Application.RibbonName = "Block Options"
'this works... (from a button)
Dim i As Integer
SendKeys "%ft"
SendKeys "c"
For i = 1 To 18
SendKeys "{TAB}"
Next i
SendKeys "{DOWN}"
SendKeys "{UP}"
SendKeys "{DOWN}"
SendKeys "{TAB}"
'this works
DoCmd.Rename "AutoKeys", acMacro, "m_AutoKeys"
'force a compile (from a button)
SendKeys "%{F11}%di"
'I don't know how to do "SaveAs ACCDE" basically
Dim sourceDB As String
Dim targetDB As String
sourceDB = Application.CurrentDb.Name
targetDB = Left(sourceDB, InStrRev(sourceDB, "\")) & "myTest.accde"
'application.ConvertAccessProject sourcedb, targetdb,
End Sub