currentitem won't work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sub bootstart()
strmyinput = InputBox("Platform?")
strmyinput2 = InputBox("recruitname?")
strmyinput3 = InputBox("TS Password?")
Set objfolder = Application.ActiveExplorer.CurrentFolder
Set objItem = objfolder.Inspector.CurrentItem
If CurrentItem.FlagIcon = 6 Then Set CurrentItem.FlagIcon = 5
If CurrentItem.FlagIcon = 5 Then Set CurrentItem.FlagIcon = 4
If CurrentItem.FlagIcon = 4 Then Set CurrentItem.FlagIcon = 2

This what I use. In the rest of the script I replace the objitem currentitem
with add so I can send custom forms. Why doesn't it take the currentitem and
flagicon?
Can someone please help me?
 
MAPIFolder object does not have an Inspector property. Do you mean
Application.ActiveInspector.CurrentItem? Or the
Application.ActiveExplorer.Selection collection?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
euhm?? no idea...the script I use is copy-pasted and then modelled from
working scripts.

All it need to do is flag the current mail in my inbox.

Dmitry Streblechenko said:
MAPIFolder object does not have an Inspector property. Do you mean
Application.ActiveInspector.CurrentItem? Or the
Application.ActiveExplorer.Selection collection?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Then do something like

for i = 1 to Application.ActiveExplorer.Selection.Count
set CurrentItem = Application.ActiveExplorer.Selection.Item(i)
If CurrentItem.FlagIcon = 6 Then Set CurrentItem.FlagIcon = 5
If CurrentItem.FlagIcon = 5 Then Set CurrentItem.FlagIcon = 4
If CurrentItem.FlagIcon = 4 Then Set CurrentItem.FlagIcon = 2
next

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Bart Cuenen said:
euhm?? no idea...the script I use is copy-pasted and then modelled from
working scripts.

All it need to do is flag the current mail in my inbox.
 
BTW, I don't know where you found that sample, but it just doesn't look
right: besides the the problem with the explorer vs inspector, are you sure
you want to use all 3 "if" statements rather than "if ..then..else"? Note
that if FlagIcon = 6 then all 3 statements will execute and you will end up
with the value of 2 rather than 5.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top