Results 1 to 5 of 5
  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
    52,815
    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

  4. #4
    stu_C is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    38
    Quote Originally Posted by sovereign View Post
    sorry for the late response got it working in the end using the replace() function


    Thank you for your help

    Regards
    sorry to hijack! how did you get the replace() to work in the body of the Email?

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    stu_c

    You are now asking a question in a 7 year old thread??
    You have multiple posts in >1 forum, and you seem confused. Think of the rest of who are trying to help you.
    Have you checked in each of your threads for a helpful response?

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