Consulting

Results 1 to 4 of 4

Thread: Help with .SaveSentMessageFolder: does not work for some folders

  1. #1

    Help with .SaveSentMessageFolder: does not work for some folders

    Hello all
    I could use some help with Outlook Macros. (having loads of fun with posting things)

    In Outlook 2010 I(alpha) have access to the folders of another account(beta)
    I normally send out reports from (beta) to get approvals.
    The code below creates the emails, adds voting buttons and attaches the browsed for reports.
    It also sets the .SaveSentMessageFolder. The issue I have is that the messages cannot be saved to the proper folder on (beta).
    The macro runs with no apparent error but the message is saved to the (alpha) Sent Items folder.
    If I change the path of the .SaveSentMessageFolder to a folder in (alpha) the macro works.
    I have tested the
    butch = "\\doofus\Inbox\randy" 'Save to folder path
    Set folder = GetFolder(butch) 'Get Save to folder object
    with a move instruction and it works both for an email in the (alpha) account and in the (beta) account.
    So I believe I have the correct object.
    Why does it ignore the .SaveSentMessageFolder for folders in the (beta) account?
    (Cannot get my code passed the post nazi)
    Last edited by Blakearino; 02-13-2014 at 04:53 PM. Reason: My salutation got cut off & code not allowed

  2. #2
    are your reports sent out as from alpha or beta?

  3. #3
    Quote Originally Posted by westconn1 View Post
    are your reports sent out as from alpha or beta?
    They are sent from beta. I am alpha
    Alpha(me)
    |-----Inbox
    |-----Afolder
    Beta
    |-----Inbox
    |-----Report1
    |-----Report2
    I can save to Afolder but not to Report1 or Report2.
    I have also tried
    Set myRecipient = ns.CreateRecipient("beta")
    myRecipient.Resolve
    Set moveToFolder = ns.GetSharedDefaultFolder(myRecipient, olFolderInbox).Folders("Report1")
    Set .SaveSentMessageFolder = moveToFolder
    With the same result. Is there a permissions issue?
    Public Sub HTML_Test()
    Dim objMsg3 As MailItem
    Dim folder As Outlook.folder
    signature = "<pr> </pr> "
    Set objMsg3 = Application.CreateItem(olMailItem)  '  create email
    With objMsg3
    .To = "" Do While .ReplyRecipients.Count > 0 ' removes current recipients .ReplyRecipients.Remove 1 Loop .ReplyRecipients.Add "beta" ' Reply To: butch = "\\alpha\Inbox\Report1" 'Save to folder path Set folder = GetFolder(butch) 'Get Save to folder object Set .SaveSentMessageFolder = folder .Subject = "" .SentOnBehalfOfName = "beta" 'the From: field .BodyFormat = olFormatHTML ' make the format HTML message .VotingOptions = "Approve;Approve with Comments;" .HTMLBody = "<p>Hi NPH, <br> <br> </p>" & signature .Display
    End With Set objMsg3 = Nothing End Sub

  4. #4
    Is there a permissions issue?
    that would be my first guess
    if you do not set the folder, where do the sentitems go by default?

Posting Permissions

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