Results 1 to 7 of 7
  1. #1
    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: Update to Macro Help (2002 and/or XP)

    1. The parameter SaveMode:=olPromptForSave needs to be changed to something that saves automatically, but I don't have time to look it up right now. If you highlight the word Close in the VB Editor and hit F1, the context-sensitive help should tell you the options for the SaveMode parameter.

    2. Not directly. If you add it to a toolbar button, you can create an accelerator key that works with Alt. To add the accelerator, drag the macro to a toolbar, right-click, and give it a name like &X-Reply. The X will appear underlined and can be activated with Alt+X.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Update to Macro Help (2002 and/or XP)

    <P ID="edit" class=small>(Edited by JohnBF on 03-Aug-04 16:28. Corrected sudden attack of bad spelling.)</P>I haven't worked with Redemption, so this answer may need tweaking.

    First, change the Close line to

    Item.Close olSave

    or if it isn't displayed, just change it to:

    Item.Save

    If you have mutliple items selected in a Folder, the Selection itself is a Collection which can be processed using a loop, such as this:

    For lngC = 1 To Outlook.ActiveExplorer.Selection.Count
    With Outlook.ActiveExplorer.Selection(lngC)
    If .Class = olMail Then ' or other desired class, or you could match against Typename(itms(lngC))
    <do whatever>
    .Save
    End If
    End With
    Next lngC

    HTH.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    New Lounger
    Join Date
    Jul 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update to Macro Help (2002 and/or XP)

    08-03-04 Post #2
    The Accelerator Key advice works great . . . Thanks!
    Unfortunately, the "Help" section wasn't too helpful for suppressing the "Save Prompt" and/or just getting the macro to choose "No" for the prompt. If you get a chance to find the "language" in Redemption to suppress this prompt or just have it choose "No", then the macro will be complete . . .
    Thanks so much for your help!!!!!!!!!

    ==============================
    08-03-04 Post #1
    Let me first "Thank You Again" for all your help. I can't explain just how much time I'll save as a result of the macro you have written for me. To make this macro "perfect", I was hoping you could help with two final enhancements:

    1. When I run this macro, everything works fine except there's a step where I'm prompted to save (or not save) the email. Is there a way to by-pass this promot or just have an "auto-selection" of Yes, save the changes?

    2. Is there a way to attach short-cut keys to this macro? (ie. control-x )

    Sub CompleteAndSendTest()
    ' Step #1: Create a reference to the open message
    ' OLD (native Outlook):
    'Dim msg As Outlook.MailItem
    'Set msg = ActiveInspector.CurrentItem
    ' NEW (Redemption library):
    Dim oMsg As Outlook.MailItem
    Set oMsg = ActiveInspector.CurrentItem
    Dim msg As Object
    Set msg = New Redemption.SafeMailItem .....................Error message occurs here
    msg.Item = oMsg
    ' Step #2: Set the subject line and send the message
    With msg
    .Subject = "Your Resume"
    .Send
    End With
    If Not (msg Is Nothing) Then Set msg = Nothing
    ' NEW:
    ' Needed in Outlook 2002 SP3, not sure about other versions
    oMsg.Close SaveMode:=olPromptForSave
    If Not (oMsg Is Nothing) Then Set oMsg = Nothing
    ' NOTE: Maybe necessary to press Send/Receive at this point,
    ' see http://www.dimastr.com/redemption/faq.htm#1
    ' Step #3: Delete the selected message in the active folder
    'Exit Sub 'Uncomment for testing without deleting
    With ActiveExplorer.Selection
    If .Count = 1 Then
    .Item(1).Delete
    Else
    ' What to do if multiple messages are selected?
    End If
    End With
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Update to Macro Help (2002 and/or XP)

    If you have additional comments or questions, please post a new reply in the thread instead of starting a new thread or editing the first post in the thread. Both are very confusing to others trying to follow a thread.

  5. #5
    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: Update to Macro Help (2002 and/or XP)

    To reply to a specific post, use the reply button for that post (see illustration attached).

  6. #6
    New Lounger
    Join Date
    Jul 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update to Macro Help (2002 and/or XP)

    Hello -

    With many thanks to members of this board, I am utilizing the below macro to automate what was once a very tedious email exercise in Outlook. However, there is still one "quirk" in this macro that I would like to eliminate/suppress/or have automatically select "No". When I run this email, I get prompted to Save my Email. I would like to be able to turn off this Prompt or at least have the macro automatically choose "No". Any suggestions?

    FYI: This macro incorporates Redemption in order to bypass the Security pactch in Outlook. Also, I have attempted to identify the line of code that probably needs to be modified below . . .

    Thanks!
    Danny

    Sub CompleteAndSendTest()
    ' Step #1: Create a reference to the open message
    ' OLD (native Outlook):
    'Dim msg As Outlook.MailItem
    'Set msg = ActiveInspector.CurrentItem
    ' NEW (Redemption library):
    Dim oMsg As Outlook.MailItem
    Set oMsg = ActiveInspector.CurrentItem
    Dim msg As Object
    Set msg = New Redemption.SafeMailItem
    msg.Item = oMsg
    ' Step #2: Set the subject line and send the message
    With msg
    .Subject = "Your Resume"
    .Send
    End With
    If Not (msg Is Nothing) Then Set msg = Nothing
    ' NEW:
    ' Needed in Outlook 2002 SP3, not sure about other versions
    oMsg.Close SaveMode:=olPromptForSave ..............................................(I believe this needs to be modified)
    If Not (oMsg Is Nothing) Then Set oMsg = Nothing
    ' NOTE: Maybe necessary to press Send/Receive at this point,
    ' see http://www.dimastr.com/redemption/faq.htm#1
    ' Step #3: Delete the selected message in the active folder
    'Exit Sub 'Uncomment for testing without deleting
    With ActiveExplorer.Selection
    If .Count = 1 Then
    .Item(1).Delete
    Else
    ' What to do if multiple messages are selected?
    End If
    End With
    End Sub

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Update to Macro Help (2002 and/or XP)

    I responded to your original post with this suggestion:

    change the Close line to
    Item.Close olSave
    or if it isn't displayed, just change it to:
    Item.Save


    In your code:

    oMsg.Close SaveMode:=olPromptForSave

    all you need to do is change my hypothetical variable called Item to oMsg and use one of the two structures.

    Does this help? Does it work?
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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