列出MsAccess宏步骤 [英] Listing MsAccess Macro Steps
本文介绍了列出MsAccess宏步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试编写一个PowerShell脚本来记录数据库。 我已经完成了一些工作,但我遇到了一个关于获取宏步骤的难点。 我可以输出宏名称而不是步骤。
I'm trying to write a powershell script to document a database. I've got a good bit done but I've ran into a sticking point around getting macro steps. I can output the macro names but not the steps.
$Acc = New-Object –com Access.Application
$Acc.OpenCurrentDataBase("C:\temp\test.accdb")
Foreach ($x in $acc.Application.CurrentProject.AllMacros)
{
$x.name
$acc.Application.SaveAsText($acc,"acMacro",$x.name,"c:\temp\test.txt")
}
$acc.CloseCurrentDatabase()
代码只是挂起并锁定了冰。访问权限已打开。
The code just hangs and locks up ice. Access does open.
推荐答案
acMacro不是字符串,而是值为4的AcObjectType。
acMacro is not a string but an AcObjectType with a value of 4.
这篇关于列出MsAccess宏步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文