PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
currentitem won't work
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
currentitem won't work
![]() |
currentitem won't work |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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! |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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! |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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! > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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! >> >> >> |
|
|
|
#5 |
|
Guest
Posts: n/a
|
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! >>> >>> >>> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

