Posts: 1,769
Threads: 410
Joined: Feb 2003
while looking at an email in the preview pane in Outlook, I'd like to be able to set the "Expires After" time without opening it.
I can't seem to find how to get ahold of the current selected item with QM. Everything seems to be based on triggers but there isn't a trigger, I just want it to act on the item I'm looking at.
here's what's failed so far.
Macro
Macro
function IDispatch'item ;;Outlook._Items'items
out
Outlook.Application a._getactive
Outlook.NameSpace ns=a.Session
Outlook.MailItem ci=item
ci.UnRead
anyone have any ideas?
Posts: 12,087
Threads: 142
Joined: Dec 2002
Macro
Macro1928
typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.2
Outlook.Application app._getactive
;get selected message
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err out "no selection"; ret
out msg.Subject
Posts: 1,769
Threads: 410
Joined: Feb 2003
never would have gotten there. thanks!!
Posts: 1,769
Threads: 410
Joined: Feb 2003
I keep getting an "object" not found error on this
Macro
Expire Message-1 week
Trigger
f //FF_Keyboard2
str foldername="Temp"
Outlook.Application app._getactive
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err out "no selection"; ret
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)
_s.timeformat("{D}")
DATE z=_s
z=z+7
msg.ExpiryTime=z
msg.Move(fdest)
I found the MAPIFolder lines from
move message in Outlook (one of my messages from almost 7 years ago)...(wait...
7 YEARS???!!!! SWEET FANCY MOSES!! I will have been here for
10 YEARS on Feb 19th!!!...wow....10 years...
hock: ..)....anyway...and am sure that I have a folder named "Temp" as a root folder (that is on the same level with Inbox, Draft, Sent, etc.). What am I missing here, typelib declaration maybe? or is it the fact I'm on 2010 make the difference?
thanks...10 years....
Posts: 12,087
Threads: 142
Joined: Dec 2002
I didn't test with 2010. Maybe need to change typelib declaration.
Usually "object not found" when QM runs as admin or uiAccess. Let the macro run in separate process as User.
Posts: 1,769
Threads: 410
Joined: Feb 2003
thanks.
I added the typelib from one of my other Outlook macs and ran it as several different user types but still same error on line with "fdest".
any other thoughts?
error line
Macro
Expire Message-1 week
Trigger
f //FF_Keyboard2
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)
typelib line
Macro
Expire Message-1 week
Trigger
f //FF_Keyboard2
typelib Outlook2 {00062FFF-0000-0000-C000-000000000046} 9.4
Posts: 12,087
Threads: 142
Joined: Dec 2002
Can test only with Office 2003. Works.
Macro
Macro1931
;/exe 1
typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.2
str foldername="Temp"
Outlook.Application app._getactive
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err out "no selection"; ret
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)
out fdest
Posts: 1,769
Threads: 410
Joined: Feb 2003
ok, here's what I did and got it to work, however, I can only narrow it down to one of 3 things.
[list=]I compacted my default "ost" data file in the account settings
I closed all my external "pst" files
opened 1st pst file and tried ->success
opened 2nd pst file and tried ->success
opened 3rd pst file and tried ->success
[/list]
it worked each time when I opened up the pst's . unfortunately I didn't try it after doing a compact so I don't know if it was the archive file steps or compact but now it works!!!
thanks.
Macro
Expire Message-1 week
Trigger
f //FF_Keyboard2
typelib Outlook2 {00062FFF-0000-0000-C000-000000000046} 9.4
str foldername="Temp"
Outlook.Application app._getactive
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err out "no selection"; ret
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)
_s.timeformat("{D}")
DATE z=_s
z=z+7
msg.ExpiryTime=z
msg.Move(fdest)
Posts: 1,769
Threads: 410
Joined: Feb 2003
dang...almost there.
I'm trying to now mark it as read but it doesn't seem to be doing the Unread="False" thing. I've tried 'save' and doing it in differ order but nothing works.
anyone marked something as read in this sort of context?
PS: I looked up 'Update' wasn't available.
Macro
Expire Message-1 week
Trigger
f //FF_Keyboard2
typelib Outlook2 {00062FFF-0000-0000-C000-000000000046} 9.4
str foldername="Temp"
Outlook.Application app._getactive
Outlook.MailItem msg=app.ActiveExplorer.Selection.Item(1); err out "no selection"; ret
Outlook.MAPIFolder froot=app.GetNamespace("MAPI").Folders.Item(1)
Outlook.MAPIFolder fdest=froot.Folders.Item(foldername)
_s.timeformat("{D}")
DATE z=_s
z=z+7
msg.UnRead = "False"
msg.Save
msg.ExpiryTime=z
;msg.Move(fdest)
Posts: 1,769
Threads: 410
Joined: Feb 2003
nevermind :roll:
the syntax is
Macro
Expire Message-1 week
Trigger
f //FF_Keyboard2
thanks though!