OutLook attrib

Greetings Talkers,
I wish the syntax that will enable it so I can launch the Outlook address book, if anybody could help me out.
It would help very much.
I think I will be able to work out the other attribs such as to, and the actual message string to send. Though if anybody knows these off the top of their head that would also help. Though it is the syntax to launch the address book that is imperative.
TIA
 

WillieG

New Member
I cannot find something at the moment to launch the Outlook Address book and I don't know if it exist because it is part of MS Outlook.
What I found that work for me with COM objects is to go to the Visual Basic Editor in the MS application. In Outlook go "Tools", "Macro", "Visual Basic Editor". In Visual Basic Editor go "View" "Object Browser".
This will give you classes and members. Right click on a selected class / member and press "Help". The help function will give you properties, methods and examples of your selection. I found that VB & progress use +- the same syntax except the . change to :
The class for the address book seems to be AddressLists. If you use the Help in VB Editor you will find a nice example which could put you on the right track.
Sorry I haven't got more time, but I hope this will help.
 
The only way I could find to do this is to execute a small VBS script.

I am not sure if this allows you to interact with the Address Book via msoutl9.olb, though.

You might be able to replicate the script using OCX.

You might also need to change the WshShell.AppActivate "Personal Folders - Microsoft Outlook" line - this needs to match what Outlook displays in its title bar when it starts. As far as I know, it has to be an exact match otherwise the script cannot connect to Outlook.

You call this in your Progress session with
def var this_command as char no-undo.
this_command = "cscript //nologo c:\bin\startab.vbs".
/* Or wherever your scripts are kept */
os-command silent value (this_command) no-wait.

startab.vbs:
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run "cmd /C " + chr(34) + "C:\Program Files\Microsoft Office\Office\outlook.exe" + chr(34) , 2
wscript.echo "Starting Outlook ..."
WshShell.AppActivate "Personal Folders - Microsoft Outlook"
WScript.Sleep 5000
wscript.echo "Connecting ..."
rem ALT-T B to start Address Book
WshShell.SendKeys "%T"
WScript.Sleep 300
WshShell.SendKeys "B"
 
In pure Progress Code:

def var wshshell as com-handle no-undo.
def var this_command as char no-undo.
create "WScript.Shell" wshshell no-error.
if valid-handle(wshshell) then do:
this_command = "C:\Program Files\Microsoft Office\Office\outlook.exe".
wshshell:run ("cmd /C " + chr(34) + "C:\Program Files\Microsoft Office\Office\outlook.exe" + chr(34),2).
os-command silent value (this_command) no-wait.
pause 2.
wshshell:AppActivate ("Personal Folders - Microsoft Outlook").
wshshell:SendKeys ("%T").
wshshell:SendKeys ("B").
end.
release object wshshell no-error.

 
Top