PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming currentitem won't work

Reply

currentitem won't work

 
Thread Tools Rate Thread
Old 24-02-2005, 05:19 PM   #1
=?Utf-8?B?QmFydCBDdWVuZW4=?=
Guest
 
Posts: n/a
Default currentitem won't work


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?
--
Welcome back, Bart Cuenen. If you're not Bart Cuenen, sign out by clicking
the Sign Out button above, and then sign in again. LMAO!
  Reply With Quote
Old 24-02-2005, 05:36 PM   #2
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: currentitem won't work

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

"Bart Cuenen" <BartCuenen@discussions.microsoft.com> wrote in message
news:416D013E-509E-4E6F-B7EA-00188B94F000@microsoft.com...
> 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?
> --
> Welcome back, Bart Cuenen. If you're not Bart Cuenen, sign out by clicking
> the Sign Out button above, and then sign in again. LMAO!



  Reply With Quote
Old 24-02-2005, 07:51 PM   #3
=?Utf-8?B?QmFydCBDdWVuZW4=?=
Guest
 
Posts: n/a
Default Re: currentitem won't work

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" wrote:

> 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
>
> "Bart Cuenen" <BartCuenen@discussions.microsoft.com> wrote in message
> news:416D013E-509E-4E6F-B7EA-00188B94F000@microsoft.com...
> > 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?
> > --
> > Welcome back, Bart Cuenen. If you're not Bart Cuenen, sign out by clicking
> > the Sign Out button above, and then sign in again. LMAO!

>
>
>

  Reply With Quote
Old 24-02-2005, 08:18 PM   #4
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: currentitem won't work

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" <BartCuenen@discussions.microsoft.com> wrote in message
news:AF31C004-D221-45BA-B4E7-24D3BFB489C5@microsoft.com...
> 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" wrote:
>
>> 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
>>
>> "Bart Cuenen" <BartCuenen@discussions.microsoft.com> wrote in message
>> news:416D013E-509E-4E6F-B7EA-00188B94F000@microsoft.com...
>> > 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?
>> > --
>> > Welcome back, Bart Cuenen. If you're not Bart Cuenen, sign out by
>> > clicking
>> > the Sign Out button above, and then sign in again. LMAO!

>>
>>
>>



  Reply With Quote
Old 24-02-2005, 10:05 PM   #5
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: currentitem won't work

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

"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message
news:ujRg23qGFHA.580@TK2MSFTNGP15.phx.gbl...
> 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" <BartCuenen@discussions.microsoft.com> wrote in message
> news:AF31C004-D221-45BA-B4E7-24D3BFB489C5@microsoft.com...
>> 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" wrote:
>>
>>> 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
>>>
>>> "Bart Cuenen" <BartCuenen@discussions.microsoft.com> wrote in message
>>> news:416D013E-509E-4E6F-B7EA-00188B94F000@microsoft.com...
>>> > 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?
>>> > --
>>> > Welcome back, Bart Cuenen. If you're not Bart Cuenen, sign out by
>>> > clicking
>>> > the Sign Out button above, and then sign in again. LMAO!
>>>
>>>
>>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off