Thanks Thanks:  0
Likes Likes:  0
Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: outlook

  1. #1
    Board Regular
    Join Date
    Jan 2017
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default outlook

    hi,

    Does any know how to add the subject line into email body, rather than copy & paste into ?

    Hoping someone can 'rescue me' & thank you for your help.


    KR
    Trevor3007

  2. #2
    Moderator Macropod's Avatar
    Join Date
    Aug 2007
    Location
    Canberra, Australia
    Posts
    2,699
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    What code are you currently using?
    Cheers
    Paul Edstein
    [MS MVP - Word]

  3. #3
    Board Regular
    Join Date
    Jan 2017
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    Quote Originally Posted by Macropod View Post
    What code are you currently using?

    morning Macropod,

    Thank you for getting back to me. I don't have any & was hoping people like yourself could supply?

    KR
    Trevor3007

  4. #4
    Moderator Macropod's Avatar
    Join Date
    Aug 2007
    Location
    Canberra, Australia
    Posts
    2,699
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    In that case, you're going to have to provide much more information than you have so far. For example, where does the subject line come from? And what about any other content - message body, email address, etc.?
    Cheers
    Paul Edstein
    [MS MVP - Word]

  5. #5
    Board Regular
    Join Date
    Jan 2017
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    Quote Originally Posted by Macropod View Post
    In that case, you're going to have to provide much more information than you have so far. For example, where does the subject line come from? And what about any other content - message body, email address, etc.?

    Hi & thanks for your reply.


    The only thing I need is the subject line IE today is Saturday 11/11/17 to show in the body of the email. I would send a screenshot but I don't know how to & there is no 'paste' option on the forum.

    KR
    Trevor3007

  6. #6
    Moderator Macropod's Avatar
    Join Date
    Aug 2007
    Location
    Canberra, Australia
    Posts
    2,699
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    So all you want is a macro that will insert the email subject somewhere in the email body? Since you're going to have to run the macro manually, it's not going to save much time/effort, unless you go to the extra effort of creating a button for the macro and assign the macro to it on the QAT. That's a lot of effort for minimal time savings.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  7. #7
    Board Regular
    Join Date
    Jan 2017
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    Quote Originally Posted by Macropod View Post
    So all you want is a macro that will insert the email subject somewhere in the email body? Since you're going to have to run the macro manually, it's not going to save much time/effort, unless you go to the extra effort of creating a button for the macro and assign the macro to it on the QAT. That's a lot of effort for minimal time savings.

    hiya,

    Yes I appreciate that but for me its worth the bother/effort. And yes I would assign a 'button'.

    Kindest regards
    Trevor3007

  8. #8
    Moderator Macropod's Avatar
    Join Date
    Aug 2007
    Location
    Canberra, Australia
    Posts
    2,699
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    Try:
    Code:
    Sub InsertHeaderText()
    'Note: This code requires references to Word, via Tools|References
    Dim olMail As Outlook.MailItem, olInsp As Outlook.Inspector, wdDoc As Word.Document
    Set olMail = Application.ActiveInspector.CurrentItem
    Set olInsp = olMail.GetInspector
    Set wdDoc = olInsp.WordEditor
    Word.Selection.InsertBefore " " & olMail.Subject
    Set wdDoc = Nothing: Set olInsp = Nothing: Set olMail = Nothing
    End Sub
    Last edited by Macropod; Nov 11th, 2017 at 05:15 AM.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  9. #9
    Board Regular
    Join Date
    Jan 2017
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    Quote Originally Posted by Macropod View Post
    Try:
    Code:
    Sub InsertHeaderText()
    'Note: This code requires references to Word, via Tools|References
    Dim olMail As Outlook.MailItem, olInsp As Outlook.Inspector, wdDoc As Word.Document
    Set olMail = Application.ActiveInspector.CurrentItem
    Set olInsp = olMail.GetInspector
    Set wdDoc = olInsp.WordEditor
    Word.Selection.InsertBefore " " & olMail.Subject
    Set wdDoc = Nothing: Set olInsp = Nothing: Set olMail = Nothing
    End Sub

    hiya :}

    Thanks for getting back so quickly.

    Run your code but debug error and this was highlighted wdDoc As Word.Document ( I coloured the text red so it would standout more)

    Sub InsertHeaderText()
    'Note: This code requires references to Word, via Tools|References
    Dim olMail As Outlook.MailItem, olInsp As Outlook.Inspector, wdDoc As Word.Document
    Set olMail = Application.ActiveInspector.CurrentItem
    Set olInsp = olMail.GetInspector
    Set wdDoc = olInsp.WordEditor
    Word.Selection.InsertBefore " " & olMail.Subject
    Set wdDoc = Nothing: Set olInsp = Nothing: Set olMail = Nothing
    End Sub


    KR
    Trevor3007

  10. #10
    Moderator Macropod's Avatar
    Join Date
    Aug 2007
    Location
    Canberra, Australia
    Posts
    2,699
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: outlook

    Did you read:
    'Note: This code requires references to Word, via Tools|References
    Cheers
    Paul Edstein
    [MS MVP - Word]

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •