Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2021, 04:33 AM
AndersKolind AndersKolind is offline Is it possible to send only columns of a word document to different mails, at once? Windows 10 Is it possible to send only columns of a word document to different mails, at once? Office 2019
Novice
Is it possible to send only columns of a word document to different mails, at once?
 
Join Date: Apr 2021
Posts: 2
AndersKolind is on a distinguished road
Post Is it possible to send only columns of a word document to different mails, at once?

Hello :-)

I'm new to this forum, and my word-skills is pretty basic.

I'm looking for a way to auto-isolate columns from a Word document, based on the initials of a person writtin in the column, and then the possibility to email it to the specific person.
Does it make any sense to You guys?

An example could be that I want to isolate and send the line which includes the "AHK" to his email:



"Meeting (0011) - HGK (initials, some randoms word, bla bla.

Meeting (0012) - AHK (initials), some randoms words, bla bla."


I'm hoping for some cool solutions :-)

Thanks so much for Your time!
Reply With Quote
  #2  
Old 04-20-2021, 06:35 AM
gmayor's Avatar
gmayor gmayor is offline Is it possible to send only columns of a word document to different mails, at once? Windows 10 Is it possible to send only columns of a word document to different mails, at once? Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could use a macro
The following will copy the selected text to an e-mail message. NOTE the comment at the top of the macro.
Code:
Sub Send_Extract_As_EMail()
'Graham Mayor - https://www.gmayor.com - Last updated - 20 Apr 2021 
'Requires the code - http://www.rondebruin.nl/win/s1/outlook/openclose.htm
'to either retrieve an open instance of Outlook or open Outlook if it is closed.
Dim OlApp As Object
Dim oItem As Object
Dim outNS As Object
Dim objDoc As Word.Document
Dim objSel As Selection
Dim strEmail As String
    strEmail = "<PR_EMAIL_ADDRESS>"
    'Let the user choose the contact from Outlook
    'And assign the email address to a variable

    strEmail = Application.GetAddress("", strEmail, _
                                      False, 1, , , True, True)
    If strEmail = "" Then
        MsgBox "User cancelled or no address listed", , "Cancel"
        GoTo lbl_Exit
    End If

    Set OlApp = OutlookApp()

    'Create a new mailitem
    Set outNS = OlApp.GetNamespace("MAPI")
    outNS.logon
    Set oItem = OlApp.CreateItem(0)
    Set objDoc = oItem.GetInspector.WordEditor
    Set objSel = objDoc.Windows(1).Selection
    With oItem
        .To = strEmail
        .Subject = InputBox("Subject?")
        Selection.Copy
        .Display
        objSel.Paste
    End With

lbl_Exit:
    'Clean up
    Set oItem = Nothing
    Set OlApp = Nothing
    Set objSel = Nothing
    Set outNS = Nothing
    Set objDoc = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 04-21-2021, 02:50 AM
AndersKolind AndersKolind is offline Is it possible to send only columns of a word document to different mails, at once? Windows 10 Is it possible to send only columns of a word document to different mails, at once? Office 2019
Novice
Is it possible to send only columns of a word document to different mails, at once?
 
Join Date: Apr 2021
Posts: 2
AndersKolind is on a distinguished road
Default

Thanks for the fast reply!

As said, I'm pretty basic, though I do know where to make macros. I just dont understand them.

Your comment at the top -> Does it mean that I have to go to the link and download something, or Is it just an example?

Will I be able to make a shortcut to that macro, and then just select some text, click the shortcut, and then it will send a mail to the selected emailadress?
Reply With Quote
  #4  
Old 04-21-2021, 03:50 AM
gmayor's Avatar
gmayor gmayor is offline Is it possible to send only columns of a word document to different mails, at once? Windows 10 Is it possible to send only columns of a word document to different mails, at once? Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The answer to both your questions is yes. The link has a function to copy that you will need. As for the button - see Installing Macros
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to send out the mails automatically boddulus Excel Programming 0 07-29-2018 05:35 PM
Setup Outlook to ONLY SEND mails ? ksor Outlook 0 03-14-2018 06:07 AM
Outlook not able to send e-mails aimforgold Outlook 0 11-01-2014 11:15 AM
Outlook 2010 Will Not Send E-Mails To Certain Users J3V Outlook 8 02-20-2013 06:47 PM
How to send mails from outlook to gmail crks Outlook 1 01-21-2011 04:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft