currentitem won't work

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?
 
D

Dmitry Streblechenko

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
 
G

Guest

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
 
D

Dmitry Streblechenko

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.
 
D

Dmitry Streblechenko

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top