Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Outlook 2007 = exporting a single email contents to Word 2007

Posted on 2013-11-23
12
403 Views
Last Modified: 2013-11-25
My OS is win 7 prof 64 bit and I use Office 2007.  I am trying to export the contents of a single email to Outlook.  Can an expert please walk me thru how to do this? Thank u.
0
Comment
Question by:jegajothy
  • 6
  • 6
12 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 39672251
Can you clarify … you are trying to exports the contents of a single email (in outlook presumably) to Outlook?

Chris
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 39672252
Sorry the title gives the game away … what from the email do you want to export and how should it appear in word?

Chris
0
 

Author Comment

by:jegajothy
ID: 39672666
in response to Chris I want to export from Outlook 2007.  Whenever one clicks on an email and reads it.  But I want to save the contents of this Outlook 2007 email that I just read to a Word 2007 document, just all the contents, either from the Sender's information to the end of that message, or maybe just the contents only.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 39672677
The scope of what is written to word we can play with … the main concern I would have the now is triggering the macro … calling it from the run menu option is the easiest i.e. a named macro that does what you ask.

Would that work for you?

Chris
0
 

Author Comment

by:jegajothy
ID: 39672679
in response to Chris,
I think a macro will work very well.  Please give me the steps to stick it wherever I am supposed to glue it.  Thank u very much for your response.
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 39672681
Place the following into an outlook code module:

Sub Q_28302258_1()
Dim wrdApp As Object
Dim doc As Object
Dim mai As MailItem
Dim GetCurrentItem As Object

    Select Case TypeName(Application.ActiveWindow)
        Case "Explorer"
            Set GetCurrentItem = Application.ActiveExplorer.Selection.Item(1)
        Case "Inspector"
            Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
    End Select
    
    If TypeName(GetCurrentItem) = "MailItem" Then
        Set mai = GetCurrentItem
        Set wrdApp = CreateObject("word.application")
        Set doc = wrdApp.documents.Add
        wrdApp.Selection.typetext mai.Body
        wrdApp.Visible = True
    Else
        Exit Sub
    End If
    
End Sub

Open in new window


Chris
0
 

Author Comment

by:jegajothy
ID: 39672743
In response to Chris, thank u for your code, I have renamed the sub to : OuttoWord, but when I ran it, I got the error as in the attached file.  Maybe I have not done any prerequisites tweaking.  Thank u.
outlook-2007-macro-error.docx
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 39672846
Typo

Sub Q_28302258_1()
Dim wrdApp As Object
Dim doc As Object
Dim mai As MailItem
Dim GetCurrentItem As Object

    Select Case TypeName(Application.ActiveWindow)
        Case "Explorer"
            Set GetCurrentItem = Application.ActiveExplorer.Selection.Item(1)
        Case "Inspector"
            Set GetCurrentItem = Application.ActiveInspector.CurrentItem
    End Select
    
    If TypeName(GetCurrentItem) = "MailItem" Then
        Set mai = GetCurrentItem
        Set wrdApp = CreateObject("word.application")
        Set doc = wrdApp.documents.Add
        wrdApp.Selection.typetext mai.Body
        wrdApp.Visible = True
    Else
        Exit Sub
    End If
    
End Sub

Open in new window


Tested the explorer scenario but skipped over the inspector session - I guess when you got the error you had an email open - assuming so this should resolve that issue.

Chris
0
 

Author Comment

by:jegajothy
ID: 39674643
In response to Chris, I am afraid that nothing happened when I ran the code with an email open.
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 39674678
There are 'classifications' of outlook objects.  A mailitem is one specific example, I have opened the script up to support any outlook object ... see if this works now.

Sub Q_28302258_2()
Dim wrdApp As Object
Dim doc As Object
Dim GetCurrentItem As Object

    Select Case TypeName(Application.ActiveWindow)
        Case "Explorer"
            Set GetCurrentItem = Application.ActiveExplorer.Selection.Item(1)
        Case "Inspector"
            Set GetCurrentItem = Application.ActiveInspector.CurrentItem
    End Select
    
       Set wrdApp = CreateObject("word.application")
        Set doc = wrdApp.documents.Add
        wrdApp.Selection.typetext GetCurrentItem.Body
        wrdApp.Visible = True
   
End Sub

Open in new window


Chris
0
 

Author Comment

by:jegajothy
ID: 39674853
Hi Chris,
I salute u for your technical knowledge especially in the programming field.  The code worked, it opened word and created a document.  Graphics in the email was rendered a a hyperlink to the web site.
Thank u and well done.
with best wishes and happy holidays.
0
 

Author Closing Comment

by:jegajothy
ID: 39674855
a walking programming genius.  Thank u for the code.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Find out what you should include to make the best professional email signature for your organization.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question