Results 1 to 3 of 3
  1. #1
    sovereign is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    30

    Using Outlook Template

    Afternoon all,



    So i have written some code to open an .oft with a subject and email address.

    but i want to use bookmarks similar to word, it seems you cant use the .item for outlook.

    can anyone point me in the right direction?

    Code:
      If [Forms]![frmClaims]![chkfirstnotificationemail] = True Then
           Dim myOlApp As Outlook.Application
           Dim MyItem As Outlook.MailItem
           
           Set myOlApp = CreateObject("Outlook.Application")
           Set MyItem = myOlApp.CreateItemFromTemplate("C:\Users\andrewb\Documents\first notification.oft")
           With MyItem
           .To = Me![Pmail]
           .Subject = "Just a quick hello"
           .Item("username").Range.Text = StrConv(GetStaffname(GetUser), vbProperCase)
           MyItem.Display
    End With
    End If
    Thank you in advanced

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,599
    You have the bookmarks established in the template? You want to change the display text of bookmarks?

    Bing: outlook template bookmarks vba change text

    Does this help http://www.vbaexpress.com/forum/show...tlook-Bookmark
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sovereign is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    30
    Quote Originally Posted by June7 View Post
    You have the bookmarks established in the template? You want to change the display text of bookmarks?

    Bing: outlook template bookmarks vba change text

    Does this help http://www.vbaexpress.com/forum/show...tlook-Bookmark
    sorry for the late response got it working in the end using the replace() function


    Thank you for your help

    Regards

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 12-15-2014, 08:18 AM
  2. Replies: 11
    Last Post: 05-20-2014, 11:32 AM
  3. Replies: 2
    Last Post: 02-23-2012, 07:21 PM
  4. Assigning Outlook task from shared Outlook mailbox
    By Remster in forum Programming
    Replies: 2
    Last Post: 11-16-2011, 04:38 AM
  5. usings a outlook template
    By kylebmorris in forum Programming
    Replies: 0
    Last Post: 07-19-2010, 01:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums