![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Why will this code just change subject to only the fist selected item?
For x = 1 To myOlSel.Count myOlSel.Item(x).Subject = strProsjektnrnavn & myOlSel.Item(x).Subject 'ad a prefix in subject Next x |
#2
|
|||
|
|||
![]()
I'm surprised it would change anything, you're not saving your changes.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "ExcelLars" wrote in message ... Why will this code just change subject to only the fist selected item? For x = 1 To myOlSel.Count myOlSel.Item(x).Subject = strProsjektnrnavn & myOlSel.Item(x).Subject 'ad a prefix in subject Next x |
#3
|
|||
|
|||
![]()
This was not the whole code....
Dim myOlApp As New Outlook.Application Dim myOlExp As Outlook.Explorer Dim myOlSel As Outlook.Selection Dim strProsjektnrnavn, strProsjektnrnavnDel1, strProsjektnrnavnDel2 As String Dim x As Integer Set myOlExp = myOlApp.ActiveExplorer Set myOlSel = myOlExp.Selection On Error Resume Next strProsjektnrnavnDel1 = "" strProsjektnrnavnDel2 = "" 'sjekker hva som er valgt i listeboksene i UserForm1 strProsjektnrnavnDel1 = ListBox1.Value strProsjektnrnavnDel2 = ListBox2.Value If CheckBox3 = True And CheckBox1 = True Then strProsjektnrnavn = "[" & strProsjektnrnavnDel1 & "] " & "[" & strProsjektnrnavnDel2 & "] " If CheckBox3 = True And CheckBox1 = False Then strProsjektnrnavn = "[" & strProsjektnrnavnDel1 & "] " If CheckBox3 = False And CheckBox1 = True Then strProsjektnrnavn = "[" & strProsjektnrnavnDel2 & "] " If CheckBox3 = False And CheckBox1 = False Then strProsjektnrnavn = "" 'Stop 'Her blir det satt inn en prefix i emnefeltet og lagt inn kategori hvis checkboks2 = true For x = 1 To myOlSel.Count Emne = myOlSel.Item(x).Subject 'myOlSel.Item(x).Subject = strProsjektnrnavn & myOlSel.Item(x).Subject 'legger inn prefix i emne myOlSel.Item(x).Subject = strProsjektnrnavn & Emne 'legger inn prefix i emne If CheckBox2 = True Then myOlSel.Item(x).Categories = strProsjektnrnavnDel2 'legger inn kategori If CheckBox4 = True Then myOlSel.Item(x).UnRead = False 'marker som lest Next x |
#4
|
|||
|
|||
![]()
You still aren't calling to save the changes.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "ExcelLars" wrote in message ... This was not the whole code.... Dim myOlApp As New Outlook.Application Dim myOlExp As Outlook.Explorer Dim myOlSel As Outlook.Selection Dim strProsjektnrnavn, strProsjektnrnavnDel1, strProsjektnrnavnDel2 As String Dim x As Integer Set myOlExp = myOlApp.ActiveExplorer Set myOlSel = myOlExp.Selection On Error Resume Next strProsjektnrnavnDel1 = "" strProsjektnrnavnDel2 = "" 'sjekker hva som er valgt i listeboksene i UserForm1 strProsjektnrnavnDel1 = ListBox1.Value strProsjektnrnavnDel2 = ListBox2.Value If CheckBox3 = True And CheckBox1 = True Then strProsjektnrnavn = "[" & strProsjektnrnavnDel1 & "] " & "[" & strProsjektnrnavnDel2 & "] " If CheckBox3 = True And CheckBox1 = False Then strProsjektnrnavn = "[" & strProsjektnrnavnDel1 & "] " If CheckBox3 = False And CheckBox1 = True Then strProsjektnrnavn = "[" & strProsjektnrnavnDel2 & "] " If CheckBox3 = False And CheckBox1 = False Then strProsjektnrnavn = "" 'Stop 'Her blir det satt inn en prefix i emnefeltet og lagt inn kategori hvis checkboks2 = true For x = 1 To myOlSel.Count Emne = myOlSel.Item(x).Subject 'myOlSel.Item(x).Subject = strProsjektnrnavn & myOlSel.Item(x).Subject 'legger inn prefix i emne myOlSel.Item(x).Subject = strProsjektnrnavn & Emne 'legger inn prefix i emne If CheckBox2 = True Then myOlSel.Item(x).Categories = strProsjektnrnavnDel2 'legger inn kategori If CheckBox4 = True Then myOlSel.Item(x).UnRead = False 'marker som lest Next x |
#5
|
|||
|
|||
![]()
The first item change, but not next. How can I save changes for the
next items? |
#6
|
|||
|
|||
![]()
What is your current code? Are you saving each item you modify in your loop?
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "ExcelLars" wrote in message ... The first item change, but not next. How can I save changes for the next items? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Date/Time Code as tracking # in Subject Line | TOMB | Outlook and VBA | 3 | April 29th 08 06:44 AM |
ListBox SelectedItem to TextBox | JP | Outlook - Using Forms | 1 | August 1st 07 01:42 PM |
Code to extract subject line | [email protected] | Outlook and VBA | 3 | August 25th 06 06:54 PM |
Change subject in all emails | DB01 | Outlook and VBA | 2 | May 28th 06 09:24 AM |
Change email subject line... | silas | Outlook Express | 1 | February 27th 06 11:59 PM |