Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Nottingham, UK, Nottinghamshire, England
    Posts
    190
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using Outlook to add data into Access or Word97

    Outlook2000, Access97, Word97 under Win NT 4
    I'd like to be able to take a custom Outlook form, containing a number of user-defined fields, and place the information in the user fields into a new record in an Access table, but I'm not very familiar with the Outlook object model (my VBA is decent though). Anyone kind enough to give me a basic generic routine? Alternatively, doing the same into a Word document table is ok (maybe even preferable, as the document can be made visible as an intranet page that much easier, I think).

    TIA

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Outlook to add data into Access or Word97

    Sounds like all you need is a few good references to the Outlook object model in action. These may not be the exact code you are looking for, but I found them helpful in teaching me Outlook ole:

    <A target="_blank" HREF=http://www.slipstick.com/dev/code/popcombobox.htm>http://www.slipstick.com/dev/code/popcombobox.htm</A>

    Spend some time at Slipstick.

    <A target="_blank" HREF=http://www.msdn.microsoft.com/library/welcome/dsmsdn/office05042000.htm>http://www.msdn.microsoft.com/library/welc...ice05042000.htm</A>
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Nottingham, UK, Nottinghamshire, England
    Posts
    190
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Outlook to add data into Access or Word97

    Thanks, Kevin, that's a useful site (though I should have thought of Helen Feddema's site where a lot of Slipstick's samples seem to be!). The only problem is that all of the samples I can see concerning transferring data from Outlook to Word (now my preference) or Access, whether from Slipstick, Helen or Microsoft, is concerned with transferring Contact data, whereas I want to transfer MailItem data! But you're right - I need the Outlook Object Model knowledge above all.
    Actually, with a lot of trial and error, I managed to accomplish a lot of what I wanted to do, i.e. pick up data from user-defined fields on a custom form and use it to populate a Word or Access table. My big problem now is - can you open a MailItem, then click a toolbar button to transfer the data you see? I can pick up the data from an indexed MailItem (myFolder.Items(index) etc), but I can't find a way to programmatically determine which item is the one currently open, i.e displayed. Any thoughts on this, anyone?

    Once again, TIA <img src=/S/smile.gif border=0 width=15 height=15>

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Using Outlook to add data into Access or Word97

    If you are "inside" a message, you can reference the displayed message this way:

    Dim myMailItem As MailItem
    Set myMailItem = ActiveInspector.CurrentItem

  5. #5
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Nottingham, UK, Nottinghamshire, England
    Posts
    190
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using Outlook to add data into Access or Word97

    Oh yes! So simple really! Like I said, I have little knowledge of the Outlook Object Model, so a concept such as 'ActiveInspector' was unknown to me. However, now I know it's there, I shall investigate further .....

    Thanks a lot for your help - it's much appreciated!

Posting Permissions

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