Finding text in open email

holleymc

Member
Outlook version
Outlook 365 32 bit
Email Account
Office 365 Exchange
Operating system::    WIndows
Outlook version:     365
Email type or host:    Microsoft 365

Hello All,

I have a daily task where I am pasting data into an email from Word. I need to "cut" the line above Sincerely and paste this into the TO field. Is this doable? Any suggestions would be most appreciated!
 
Hi, can you show an example of what you cut. (use fake info)
 
Does the info change?
Easiest is to create a template. If it's more complicated as in things change, then macro us the way to go
 
It would be
Hi, can you show an example of what you cut. (use fake info)
Thanks for your replies!! It would be the entire line preceding Sincerely. It would contain either a single or multiple email address(es). That would vary. The only static would be two lines down containing the salutation Sincerely. Does that make any sense?
 
If the line includes email address(es), then you can copy that address and paste into the TO field.
Each address in the TO field needs to be delimited using ; character.
Example: jdoe@abc.com; bdoe@abc.com;
 
If the line includes email address(es), then you can copy that address and paste into the TO field.
Each address in the TO field needs to be delimited using ; character.
Example: jdoe@abc.com; bdoe@abc.com;
Right, thats the goal, but I want to be able to find and copy this using a macro.
 
OK ... Diane Poremsky is your best resource for a macro.
 
OK ... Diane Poremsky is your best resource for a macro.
Thanks, I have one I've been working on, but I can't get constant results using the send keys to get to the location.
 
Perhaps you can post the one you are working on.
 
This is what I'm using... the information is in clipboard copied from Word.
Code:
Sub Paste2()
Dim outApp As Object
Dim OutMail As Object
Dim olInsp As Object
Dim myItem As Outlook.MailItem
Dim str_jpeg_file As String



'Dim xlSheet As Worksheet
Dim wdDoc As Object
Dim oRng As Object
    'Set xlSheet = ActiveWorkbook.Sheets("Unapproved")
    'xlSheet.UsedRange.Copy

    'On Error Resume Next
    Set outApp = GetObject(, "Outlook.Application")
    If Err <> 0 Then Set outApp = CreateObject("Outlook.Application")
    On Error GoTo 0
   
    'Set OutMail = OutApp.CreateItem(0)
    Set myItem = Application.CreateItemFromTemplate("C:\Users\Statement Customer .msg")
    myItem.Display
    With myItem
        .BodyFormat = 2
        .To = ""
        '.To = TwentythirdItem
        .CC = ""
        .BCC = ""
        .Subject = "Customer Statement "

'SendKeys "{~}^({v})", True
SendKeys "{down)^({v})", True
End With
End Sub
 
.....

I think you should use AutoIt.

Any further help you need, i think you need to add more description or example of the document, what it is you need help with.
You said Word, but showing an example of importing from Excel ... ????
 
.....

I think you should use AutoIt.

Any further help you need, i think you need to add more description or example of the document, what it is you need help with.
You said Word, but showing an example of importing from Excel ... ????
I've not heard of AutoIt before, I will have to try that out... I thought I had removed the references to Excel. I used the code found from another thread to get the paste function.

I have copied a statement from word and trying to paste into an email template. Only thing I am having a problem with is some of our people have an extra line and it throws off where I am cutting once it paste into the template and I get the line above it. The only constant I can find is I need to "cut" two lines above sincerely. This is where the email address(es) will be located. Hope that makes sense.
 
Similar threads
Thread starter Title Forum Replies Date
bhamberg Finding a rouge rule... Using Outlook 6
K Outlook.com is not showing, or finding via search, all my Contacts (People) Using Outlook 0
A ScanPST finding errors but no Repair button Using Outlook 2
F Finding Meetings/Tasks in a date range Using Outlook 1
M Finding Tasks in Outlook 365 Using Outlook 1
A "search people" not finding all contacts Using Outlook 17
Commodore Finding items from last 7 days Using Outlook 2
T Need help with finding/updating task Outlook VBA and Custom Forms 1
M Finding a folder by name Outlook 2013 Using Outlook 4
S Finding Distribution List Name Outlook VBA and Custom Forms 3
Ron Kirschner Finding a rule Using Outlook 1
A OL13 Calendar Search not finding most items Using Outlook 15
L Finding deleted contact from shared folder. Exchange Server Administration 1
G finding Outlook 2010 pst in Windows XP Using Outlook 2
P finding a folder containing an email item Using Outlook 0
S Finding an inbox email question Outlook VBA and Custom Forms 2
C Finding an email address based on a name Outlook VBA and Custom Forms 7
N Finding messages by conversation macro Outlook VBA and Custom Forms 1
M Outlook VBA Form not finding FOR LOOP -- Error message Outlook VBA and Custom Forms 2
P Email and calendar entry text now shifts right about 3 tabs worth of space Using Outlook 1
M Folder names - rich text Using Outlook 6
E Replying to a plain text e-mail with HTML Using Outlook 2
D Can't read some emails - text size too small. Using Outlook 2
AndyZ Contact Custom Form Tiny Text Outlook VBA and Custom Forms 3
D Delete selected text in outgoing email body Outlook VBA and Custom Forms 0
kburrows Outlook Email Body Text Disappears/Overlaps, Folders Switch Around when You Hover, Excel Opens Randomly and Runs in the Background - Profile Corrupt? Using Outlook 0
J PSA: How to create custom keyboard shortcut for "Paste Unformatted Text" in Outlook on Windows Outlook VBA and Custom Forms 1
Witzker Add a text line at the end of the note field in all selected Contacts Outlook VBA and Custom Forms 7
O Replace hard returns with soft returns on selected text and button to QAT Using Outlook 5
J Outlook 365 Emails showing as links and text only Using Outlook 4
R How to force Outlook to use plain text in notes for Contacts? Using Outlook 1
J Text icon in Quick Access toolbar ? Using Outlook 2
S New Outlook Appointment - Select All Body Text and Change Font and Size Outlook VBA and Custom Forms 1
Z Copy specific email body text Outlook VBA and Custom Forms 0
L did MS ever add way to text via Outlook Using Outlook 5
B Outlook 365 Populate Outlook Task UDFs from a UDF text string Outlook VBA and Custom Forms 2
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1
BartH Add a string to the conditions in .Conditions.BodyOrSubject.Text Outlook VBA and Custom Forms 2
S HTML to Plain Text Macro - Help Outlook VBA and Custom Forms 1
S Unable to extract text from an Outlook email message Using Outlook 2
T Original email text not shown when replying or forwarding the email. Using Outlook 9
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
P Forwarding emails issue with special characters replacing text body Using Outlook 1
J Autoreply email recieved from specific sender after deleting some text from body. Using Outlook 0
O Outlook tasks - Add text column with multiple lines Using Outlook 3
S Body text of Email from invite date/time Outlook VBA and Custom Forms 7
T Why does outlook 2010 convert only some forum notifications to plain text? Using Outlook 0
Z VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
J Outlook 2013 Change color of text in data fields of contacts in Outlook 2013? Using Outlook 10
V Limiting text length in free text field Outlook VBA and Custom Forms 2

Similar threads

Back
Top