Outlook 2007 Delete and Paste Between Fields

Status
Not open for further replies.

LMS

Senior Member
Outlook version
Email Account
Exchange Server
I have a number of new fields the contact form which are date fields and combobox text fields. Is there simple macro that deletes what's in that field of the contact, and pastes it to a different field?
 
So in that code, just change the Custom1 to the field name I want it to come to and then change User1 to the name of the field it comes from? Correct?
 
Thanks so much as I have a lot to do.....and this code works perfectly re between two commboboxes....but when I run the code, it asks what folder to be in, and I have to answer that my selected a folder from the list that shows up....so is there a way I don't have to select a folder as that takes a lot more time as I have many many folders:

Here is the code and its great ...thanks so much:

Sub ConvertFields()
Dim objApp As Application
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Dim objItems As Items
Dim objItem As Object
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
If Not objFolder Is Nothing Then
Set objItems = objFolder.Items
For Each objItem In objItems
' make sure you have a Contact item
If objItem.Class = olContact Then
' convert to your published custom form
objItem.MessageClass = "IPM.Contact.Contact Form 1"
' copy data to your custom fields
objItem.UserProperties("Status 1:") = objItem.UserProperties("First Status:")

objItem.UserProperties("First Status:") = ""

objItem.Save
End If
Next
End If
Set objItems = Nothing
Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing

End Sub
 
that line shows up as an error and it says object requried.....any thing as this is important
 
Thanks again...I changed it but it did not do it....it did nothing....

Secondly, the code that works after picking the folder, does not work for a date field situation...

So two things to finish.......don't want to have to pick a folder....and make the date fields work with this........and by the way as to the code that works so far, I can select more than one contact and its does form each contact in the selected contact
 
It's a base macro - you need to edit it to make it work for your needs.

This line tells it to apply to all items in the folder:

For Each objItem In objItems

if you want to use it on the selected item only, you need to change it to use GetCurrentItem() or Selection.Item(1), same as you use in any of your other macros.

For the date, try using UserProperties("field").value
 
I fixed the name of the date field and it works.....but the line objItem.UserProperties("DateFieldName") = "" is an error and when I took it out, the date moves over but the initial field is not empty

And I don't understand what to change so I don't have to select the folder......as when I select a list of contacts it works when I select the folder from the folder list that shows....

So I want to delete the date field that it comes from and I don't understand what to change re the code for not having to select a folder
 
I created a small new date field in the contact form at the bottom, and leave it as None....meaning, not date...and just made in the macro that the date field that adds to the other field, then that first date field is set up as it equals the other little field I created, and it shows up as empty....

So just need to know how to now have to select a folder...and please give me the details not just the concept...thanks so much
 
And specifically what do I change so it just works eithe selected contacts not all contacts in a folder?
 
I changed the full code per the concepts you gave me, and it works with either one, and I found thru your area the Function to add. But it does not work for a list of contacts I select, only one that is selecte or open...so is there something to add or change that does it for a list that I select?

And here is what is working so far:

Sub ConvertStatustoStatus1test()
Dim objApp As Application
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Dim objItem As Object
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")

Set objItem = objApp.ActiveExplorer.Selection.Item(1)

objItem.UserProperties("Status 1:") = objItem.UserProperties("First Status:")

objItem.UserProperties("First Status:") = ""

objItem.Save

Set objItem = Nothing
Set objFolder = Nothing
Set objNS = Nothing
Set objApp = Nothing

End Sub
 
I read in one of your areas the code that changes a field for the selected contacts. I think you called it Bulk. So how can we use that for the concepts of changing a field from another field and the field it is coming from is "".
 
Thats what I read but don't know how to change for this change to the selected contacts:

objItem.UserProperties("Status 1:") = objItem.UserProperties("First Status:")

objItem.UserProperties("First Status:") = ""
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
L Outlook 2007 Delete Email Addresses Using Outlook 19
S can't delete duplicate account under Outlook 2007 (Win 7) Using Outlook 16
L How can I delete stationery from Actions, New Mail Message Using in outlook 2007? Using Outlook 6
S Looking for client-side method (Outlook 2007/Exchange 2007) for users to delete Outlook VBA and Custom Forms 2
D Outlook 2007 Recovering E-Mails Using Outlook 0
W Transfer Outlook 2016 autocomplete file to Outlook 2007 Using Outlook 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
S Outlook 2007 crash linked to gdiplus.dll Using Outlook 0
S Outlook 2007 - Automatic purge fail Using Outlook 0
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 2
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
S Verwendung von Outlook 2007 Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
S outlook 2007 calendar search Using Outlook 6
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
J Outlook 2007 Hide Messages Option not Available Using Outlook 2
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
B Server errors Outlook 2007 Using Outlook 1
S Reboot of frozen windows7 results in changed outlook 2007 settings Using Outlook 1
S Outlook 2007 printing wrong email address at top of page Using Outlook 8
M Configure outlook 2007 to accept digital signatures Using Outlook 2
D Outlook 2007 crashes when opening an email Using Outlook 2
R New chap saying hello and needing advice on Outlook 2007 thumbnails Using Outlook 3
icacream From Outlook 2007 to 2016 ! Using Outlook 9
vodkasoda Object could not be found Error in Outlook 2007 Outlook VBA and Custom Forms 5
S Outlook 2007: Address Cards allow entering text! Why? Using Outlook 3
S View Appointment in Text Wrap in Outlook 2007 Month Calendar View Using Outlook 0
L Outlook 2007 Separate the Send/Receive functions Using Outlook 2
M Outlook 2007 Contacts Glitch: Creating a new email Using Outlook 1
C Move from Outlook 2007 Enterprise (MOE) to Outlook Pro plus 2007 Using Outlook 1
J reinstalling Outlook 2007 asking for user name & password Using Outlook 14
P outlook addin unloaded in office 2007 Using Outlook 0
B Fonts in Outlook 2007 Using Outlook 4
R Add Exchange Account to existing POP3 Outlook 2007 Profile Using Outlook 0
C out of space in file group Outlook 2007 Using Outlook 2
A Moving archived contents in Outlook 2007 back into working folders Using Outlook 0
P Outlook 2007 Email Categorization using VBA Outlook VBA and Custom Forms 1
M Unable to Configure Gmail Account in Outlook 2007 Using Outlook 1
R Outlook 2007 or 2010 - Lock Down Functionality Outlook VBA and Custom Forms 3
S Outlook 2007, windows 10 Font size Using Outlook 1
Diane Poremsky Manually create a POP3 account in Outlook 2007 Using Outlook 0
J Can Click to Drag Custom Form Field But Cannot Drop When Designing in Outlook 2007 Outlook VBA and Custom Forms 2
L Outlook 2007 Font Using Outlook 3

Similar threads

Back
Top