Premise from Premise: Accessing Outlook information OR launching external file

Motorola Premise

Shinyshoes

Member
I wanted to be able to read the appointment information from outlook into premise.  I found some scripts on the internet to accomplish this, but they don't work correctly in Premise.  If I run them from a .vbs file it does what I want it to, but if i run it from premise it hangs without any error messages.  I tried using a shell command (wscript.shell or shell.application) to launch the .vbs file and I'm not having success.
 
Is there a different way to connect to outlook that I am unaware of? otherwise, is there a way I can launch this .vbs script on the hard drive from within premise?
 
For reference, below is a truncated version of my code.
 

dim filesys, filetxt
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("c:\somefile.txt", 2, True)

Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
set objFolder = objNS.GetDefaultFolder(9)
Set colCal = objFolder.Items

dtestart = date
dteEnd = date
colCal.Sort "[Start]"
colCal.IncludeRecurrences = True
strFind = "[Start] <= " & Quote(Formatdatetime(dteEnd, 2) & " 11:59 PM") & " AND [End] > " & Quote(Formatdatetime(dteStart, 2) & " 12:00 AM")
Set colSpanItems = colCal.Restrict(strFind)

For Each objAppt In colSpanItems
filetxt.writeline "At " & objappt.start & ": " & objAppt.Subject & "."
Next

Set objAppt = Nothing
Set colSpanItems = Nothing
Set colCal = Nothing
set objFolder = Nothing
set objNS = nothing
set objOL = nothing

 
 
 
Hi Shinyshoes, haven't seen you in the Premise forum in a while!
 
I haven't played around with MS Office classes yet (from within Premise Builder), but what you are doing sounds neat!  Please consider posting your module once it's complete ;)
 
I have used the file object successfully under Windows XP and Windows 7 64-bit.  123 also posted a documenter module too.  It writes lines to an external file, documenting entire modules!  The doorbell module I recently posted uses the file object too, but I suspect you have this part working already and your only having trouble with launching the .vbs file.
 
I know there were necessary workarounds in the past for executing an application using Premise's vbscript interpreter.  See this thread as it talks about a similar issue and you get a feel for the history involved: http://cocoontech.com/forums/topic/10929-how-to-get-out-of-full-screen-mode-in-ie/
 
If you don't mind running EventGhost it would be an easy work around to launching the .vbs file, provided it was on a PC running EventGhost and that the PC was on the same local network as the Premise server.  Premise then can use an PremiseEventGhost module I've created to talk to EventGhost.  You'll then have a lot of control over the particular PC.
 
I can send you the beta module (has documented instructions) if you PM me your email and promise to provide feedback.  Please be critical as I plan to post the instructions and module on EventGhost's site.  These users will not initially be familiar with Premise, but my hope is that they will want to join us and begin posting modules.
 
In short, what I think that happened (way before I started using Premise):
 
1. system.CreateProcess used to work for starting external applications (from within Premise), but XP SP2 removed this ability (presumably due to some security related issue).
2. CreateObject("WScript.Shell") worked until XP SP3, when again MS decided to change some security permissions.
3. Now, I'm not sure what folks are using, but I created PremiseEventGhost that will do it just fine.  I always wondered if someone could build an add-in that would get around this security limitation on executing external programs.  My guess is this would be trivial, but I have only played with the SDK once. 
 
I suspect these issues are due to either with the version of windows (and its applicable security updates) or even with the version of Office you are using as I believe even Office has security updates!?!
 
Back
Top