Syntax: %comset(comvariable,propertyname,newvalue,arguments)

Sets the specified property of a COM object. Use %comcreate to create the comvariable reference. If the property requires optional arguments, list them after the new value. Note that COM Properties are CASE SENSITIVE


#VAR Outlook %comcreate("Outlook.Application")
#VAR NameSpace %comget(Outlook, "GetNamespace", "MAPI")
#VAR Folders %comget(NameSpace, "Folders", "InBox")
#VAR InBox %comget(Folders, "Folders", "InBox")
#VAR Msg %comget(InBox,"Items",1)

#CALL %comset(Msg,"Subject","This is a test")
#CALL @Msg.Save

Retrieves the first email message in your InBox (stored in Msg). Then changes the Subject property of that message to "This is a test". Then, using the #COM command, the new message is saved.

You can also use the more conventional syntax:

#VAR Msg.Subject "This is a test"
#CALL @Msg.Save

Add comment

Login or register to post comments