Outlook 2007 Copy Text Field

Status
Not open for further replies.

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
You gave me the code to copy the e-mail address which worked perfecting, and it works for other objects in the Contact form, but not for the new fields I created....so here is the code you gave me and I substituted the TextBox for the Email1Address and it does not work....so is there an easy way to fix this?

Sub CopyStatusDate()

Dim oContact As ContactItem

'DataObj As MSForms.DataObject
Set oContact = ActiveExplorer().Selection.Item(1)
Set DataObj = New MSForms.DataObject
DataObj.SetText oContact.TextBox4
DataObj.PutInClipboard

End Sub
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Thanks so much. So the test of the code is the same?
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
I did the following and it did not work and the line I changed shows up yellow:
Sub CopyStatusDate()

Dim oContact As ContactItem

'DataObj As MSForms.DataObject
Set oContact = ActiveExplorer().Selection.Item(1)
Set DataObj = New MSForms.DataObject
DataObj.SetText oContact.UserProperties("TextBox4")
DataObj.PutInClipboard

End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Oh, the textbox is not a field - it's a control. The line i gave you is for custom fields. You'll probably need to use a controls("textbox") line like you did in the other macros.
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
So what is the code for purposes of copy please?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I have no idea - some partition of this i presume - item.getinspector.modifiedformpages("General").controls("Phone1").text - but i have no idea for sure.

DataObj.SetText oContact.getinspector.modifiedformpages("General").controls("textbox")

or maybe

DataObj.SetText oContact.controls("textbox").value
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Thanks to the Smart Woman!!!:):D:rolleyes:

I tried them and that did not work, but you said before to refer to userproperties....so instead of the name of the textbox, since each textbox is with a field that I created so each one holds all as I was told each textbox should refer to a new fields...so I used the names of the fields and it works!!!

But, the text that is a date, shows up in the contact with the words...for example, Thursday, November 29, 2013 but when I paste what from macro that copies it, it shows up as just numbers 13/29/2013 7am.....so see below that works for both dates and words and is there something to adjust so when I paste the date, is the words and the date etc. And secondly, itstead of copy whats in the textbox, can we change the macro so it deletes whats in the textbox?

Thanks so so much!!

Sub CopyStatusDate()

Dim oContact As ContactItem

'DataObj As MSForms.DataObject
Set oContact = ActiveExplorer().Selection.Item(1)
Set DataObj = New MSForms.DataObject
DataObj.SetText oContact.UserProperties("Status Date")
DataObj.PutInClipboard

End Sub

Sub CopyStatus()

Dim oContact As ContactItem

'DataObj As MSForms.DataObject
Set oContact = ActiveExplorer().Selection.Item(1)
Set DataObj = New MSForms.DataObject
DataObj.SetText oContact.UserProperties("First Status:")
DataObj.PutInClipboard

End Sub
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
L Outlook 2007 Copy Email Address in To Field Using Outlook 11
Z Copy Outlook 2007 "AutoComplete Contacts” to Outlook 2010 Using Outlook 7
P I have Outlook 2007 on a two year old computer running Vista. How do I copy my Outlook Contacts list and move them over to Outlook 2010 on a brand new Using Outlook 1
M Outlook 2007 Copy-Paste problems Using Outlook 6
L Outlook 2007. A copy of all incoming emails go to Junk folder. __ Using Outlook 2
S Outlook 2007 PST Corrupt - Transfer Copy Problem Using Outlook 9
L Calendar in Outlook 2007 replacing items/appointments with a "Copy" Using Outlook 2
C copy Xp Outlook address book tp 2007 Outlook Using Outlook 2
B Unable to get Leave a copy of message on server to stay checked on Outlook 2007 Using Outlook 1
R Outlook 2003 to Outlook 2007 *.pst file copy Using Outlook 1
N Outlook 2007 - Attachment Copy/Paste issue Using Outlook 1
A How to remove 'COPY:' from Outlook calendar entries in Outlook 2007 Using Outlook 1
P Outlook 2007 sends copy of forwarded mail to my inbox????? Using Outlook 0
M i want a copy of my mail on web after synchronisation with outlook 2007 Using Outlook 0
D I have two computers, a desktop with Windows XP and Outlook 2003 on it, and a laptop with Windows Vista and Outlook 2007 on it. I would like to copy Using Outlook 1
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 3
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 New Slipstick.com Articles 0
Similar threads


















































Top