Results 1 to 6 of 6

Thread: Word & Outlook

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    30

    Word & Outlook

    Is there anyway of extracting lines out of an email in Outlook, and importing them into the relevant boxes in a Word doc (which has already been created as a form)?
    e.g:

    The Email looks a little like:

    Learning Grant Application Form

    Your company name: LEARN.org.uk ltd
    Your name: Zaheer Laher
    Your position in the company: Company Secretary - Chair

    The Word doc looks a little like:

    Company Name: box1
    Client: box2
    Job Title: box3


    Could this Word doc be set up as a template like when you do a mail merge?? If so how??

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Word & Outlook

    The problem with a mailmerge is that you need a datasource. How are you specifing the emails to merge?

    If you search by my username and Outlook you will find allot of code examples on programming against Outlook.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    New Member
    Join Date
    Jul 2005
    Posts
    15

    Re: Word & Outlook

    I've created this VBScript file which scans a chosen Mailbox and folder for messages addressed to me. It could be easily pasted into VBA should you require. The settings are specified in the .ini which must have the same name as the application and exist in the same folder.

    You can use the code here to open an email (just take out the .Display if you want it to be hidden from the user) and then you can read from the email by setting .body to a string.

    Hope this helps,

    sugarflux

    *Please rate my post if i have helped you!*
    Attached Files Attached Files

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Word & Outlook

    Reading the email is not the problem. The problem is the they want to use it as a datasource for a Word Mailmerge.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    New Member
    Join Date
    Jul 2005
    Posts
    15

    Re: Word & Outlook

    OK. njwilli didn't mention that s/he wanted to specifically perform a mail merge - just that s/he wanted to pull lines out of an email and push them into a Microsoft Word form.

    The way i would do this is search for the relevent email, read the email in line by line and push the required data in to the relevant form fields.

    s

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Word & Outlook

    Ya, thats the problem. To search in Outlook from Word would bring up the Security prompt. Not to mention that it will be slow
    if it involves allot of emails. You might have better performance using DAO or ADO to retrieve a recordset of emails and that
    could be used as the DataSource for a mailmerge in Word.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width