?
Solved

Outlook Reply Form

Posted on 2006-03-24
14
Medium Priority
?
765 Views
Last Modified: 2010-08-05
Can someone tell me how to create a macro called RFP (Request for Projector) that when executed will enter text into the comment field of a reply form so that all I have to do is click on Send.  Any assistance will be greatly appreciated. My knowledge of VB is none.

Thanks in advance
0
Comment
Question by:Seb112860
  • 7
  • 7
14 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 16283261
Hi Seb112860,

> enter text into the comment field of a reply form
What kind of reply form?  A message?

Cheers!
0
 

Author Comment

by:Seb112860
ID: 16308681
A form that was created in Outlook via Tools > Forms > Design a form.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 16309209
I understood that.  My question was what kind of form?  Is it one based on a message, on a task, an appointment, or something else?
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 

Author Comment

by:Seb112860
ID: 16312952
Message.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 16317537
Here's the macro for doing this.  
1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expended, expand Modules and click on Module1
4.  Copy the macro and paste it into the right-hand pane of the VB editor window.
5.  Click the diskette icon on the toolbar to save the changes
6.  Close the VB Editor
7.  Click Tools->Macro->Security
8.  Change the Security Level to Medium

To use this, open a message and click reply or forward.  Now run the macro.  It'll insert your text at the top of the message.

Sub RequestForProjector()
    Dim olkMessage As Outlook.MailItem, _
        strText As String
    'Edit the text on the next line as desired.
    strText = "My standard text for Request for Projector."
    If Application.ActiveInspector.CurrentItem.Class = olMail Then
        Set olkMessage = Application.ActiveInspector.CurrentItem
        If olkMessage.BodyFormat = olFormatHTML Then
            olkMessage.HTMLBody = strText & olkMessage.HTMLBody
        Else
            olkMessage.Body = strText & olkMessage.Body
        End If
        olkMessage.Display
    End If
End Sub
0
 

Author Comment

by:Seb112860
ID: 16318728
When I ran the macro, it didn't give me any errors but it didn't insert any text into the comments field.  Any ideas?

Thanks in advance
0
 

Author Comment

by:Seb112860
ID: 16319713
Please accept my appologies.  When I ran the code on a regular message after clicking on reply it worked in the body of the message.  I guess the form is something other than a message.  How can I tell exactly what the form is created from?
0
 
LVL 76

Expert Comment

by:David Lee
ID: 16319875
Launch the form designer (Tools->Forms->Design a Form) and select this form.  Look toward the bottom of that dialog-box and you'll see the type of form.  It'll begin with "IPM."  Go ahead and open the form in the designer and select that field.  Let me know what the field name is.
0
 

Author Comment

by:Seb112860
ID: 16320105
It's a IPM.Note and the name of the field is TextBox1.  On the Value tab next to Choose Field it says LP Reply Comments.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 1000 total points
ID: 16327145
Ok, try this.

Sub RequestForProjector()
    Dim olkMessage As Object, _
        strText As String
    'Edit the text on the next line as desired.
    strText = "My standard text for Request for Projector."
    If Application.ActiveInspector.CurrentItem.Class = olNote Then
        Set olkMessage = Application.ActiveInspector.CurrentItem
        olkMessage.UserProperties("LP Reply Comments") = strText & olkMessage.UserProperties("LP Reply Comments")
        olkMessage.Display
    End If
End Sub
0
 

Author Comment

by:Seb112860
ID: 16328638
It didn't work.  When I try it in a regular message and change olNote to olMail it works but it doesn't work when I click on reply on a form and click in the comments field and execute the macro.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 16328669
I can only think of two explanations.  One, the form class is not IPM.Note or two, the field name is not "LP Reply Comments".
0
 

Author Comment

by:Seb112860
ID: 16329081
I recopied the code and changed olNote to olMail and tried again and I was pleasantly shocked when it worked.  I tried exactly what you instructed me to and it didn't work but decided to try again and the second time around it did work.

Thanks so much for all of your assistance.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 16330854
Excellent.  You're welcome.  Glad I could help out.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 trialware OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their Exchange server is no longer available or other critical issues with Exchange server or impo…
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question