突然有些兴致想要回家 overtime,谁知道做了一把火星人,遇到了 transit 以来让我觉得最 ridiculous 的笑话 ── Office 2008 for Mac OS X 竟然不支持 VBA,which means “existing macros in Office documents will be round-tripped across file open and save, but you will not be able to edit them and you will not be able to run them on the Mac”。没有 VBA,那么在 Mac 下用什么做 Office 的 scripting 呢?答案是 Applescript。于是乎这样的一段 VB
Dim newWkbk As Workbook Set newWkbk = Workbooks.Add With newWkbk .AcceptLabelsInFormulas = False .PrecisionAsDisplayed = True End With
在 Office 2008 里面需要这样写
tell application "Microsoft Excel" set newWkbk to make new workbook tell newWkbk set accept labels in formulas to false set precision as displayed to true end tell end tell
Office 的 Mac 开发团队说,除了 syntactical 的不同,任何 VB 可以做的事都可以用 Applescript 实现。这点我倒是不怀疑,甚至喜欢用这种脚本语言写 Mac 下 inter apps 的脚本。But, but, Applescript can not be implemented on office’s Windows desktop!I agree that any apps ported to Mac should be as Mac-like as possible, use Mac features, and take advantage of the Mac operating system. However, as far as Office is concerned, the most important thing is cross platform compatibility!
语法高亮很不错哦~
set precision as displayed to true
是什么意思?