Solved

Outlook Forms!

Posted on 2004-04-30
19
854 Views
Last Modified: 2010-04-08
Product: Outlook 2002
I use a group mailbox for sending out quota increase responses.
There are 6 other members on my team - and we rotate this process, so I want an Outlook form model for this solution.

We get tickets for quota increases on our network servers.
We review them and then either approve or deny them, make the modification (quota adjustment) and send them an email notice from our group mailbox.

I'm envisioning a form that would be set up with
a)"Support Personnel" in the From box
b)Ticket: [ticket #] in the subject box
c) a combo box for either user or business (personal or group share)
d) a combo (or radio button) with approve/deny
e) the amount of the increase

Here are the different messages that should be generated based upon those choices:

Your request for additional storage capacity on [business] share SHARENAME has been approved, effective immediately, for the AMOUNT [MB/GB] increase requested.
Your request for additional storage capacity on your home share (H drive) has been approved, effective immediately, for the AMOUNT [MB/GB] increase requested

Your request for additional storage capacity on [business] share SHARENAME has been approved, effective immediately, for a AMOUNT [MB/GB] increase.
Your request for additional storage capacity on your home share (H drive) has been approved, effective immediately, for a AMOUNT [MB/GB] increase.

Your request for additional storage capacity on [business] share SHARENAME has been denied. [Explaination].
Your request for additional storage capacity on your home share (H drive) has been denied. [Explaination - which is usually: Home shares are limited to 200mb total quota.  If you cannot archive the data on your H drive, you will need to utilize a group share for storing this data]

SHARENAME should be a text field
AMOUNT should be a text field
[MB/GB] - bonus if this could be combo box or converted, but easy enough to type in the AMOUNT field
First line should be chosen in each if [business] is selected from the combo
Second line should be chosen in each if [user] is selected from the combo
Approval/Denials - self explanatory.

Is this doable?  I don't really know how difficult it would be since it's been over a year since I've developed forms.  But I know my way around them.  Thanx!
0
Comment
Question by:sirbounty
  • 10
  • 9
19 Comments
 
LVL 13

Expert Comment

by:stefri
ID: 10971220
It is but:
From field cant be preset (will be taken from mailbox name)
We cant only provide the code, not the form itself.
How do you receive the request? By mail?
Stefri
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10971298
Well, I've heard that the From field can't be preset, but I've done that part before...and it works.
BUT - the strange this is (and I'll try to explain this properly)...
If I run the form - I see the alias in the From field.  If I do nothing for about 3 seconds it disappears.
However, if I have the recipient's alias in my paste buffer and immeidately paste it and hit Ctrl+K to resolve, everything's great - so I'm not worried about that bit...

Requests are received by our ticketing system.
I know this can't be completely automated - I just would like to get around typing so much.

Understand about the form - it's the code I'd need help on - I always have difficulty with Outlook's coding, for some reason...
0
 
LVL 13

Expert Comment

by:stefri
ID: 10971301
do you want to reply to the received mail (have the reply in the answer)
stefri
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10971307
Not sure I follow you there...?
0
 
LVL 13

Expert Comment

by:stefri
ID: 10971318
What I meant:
The form is displayed
you Select the mail requesting for an increase
click on the Generate mail button
the text you provided will be added in the received mail as if you had manually added it while replying
Stefri
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10971340
Well, we don't get an email notice on this.
We receive the ticket request in a seperate application.
Do a bit of investigating first - then send an email with the results.
So it's just a new message...
0
 
LVL 13

Expert Comment

by:stefri
ID: 10971344
Got it
Stefri
0
 
LVL 13

Expert Comment

by:stefri
ID: 10971396
BTW: I do not understand why a combo for busines/user; cant it be option button as for accept/denied
Stefri
0
 
LVL 13

Accepted Solution

by:
stefri earned 500 total points
ID: 10971562
Create a form based on message
Hide Message page
Rename P.2 to "Approve Increase"
Add a Frame
Add 2 Radio buttons:
Name: Business
Name: User
Groupname (Advanced Properties): userbusiness
Add 2 labels:
Caption businness
Caption user

Add 2 Radio buttons
Name: approved
Name: denied
Groupname (Advanced Properties): approveddenied
Add 2 labels
Caption: Approved
Caption Denied

Add label caption Ticket
Add Textbox : ticket
Add label caption Sharename
Add TextBox : SHARENAME
Add label caption Amount
Add TextBox: AMOUNT
Add 2 Radio buttons
Name: MB
Name: GB
Groupname (Advanced Properties): MBGB

Add label caption: Comments
Add TextBox (mutiline): comments

Add Button: Submit caption Generate

Ticket, sharename and Amount are mandatory (<> empty string)

Add the code below

Option Explicit

dim myControls
dim reqBusApp
dim reqBusden
dim reqUseApp
dim reqUseDen
dim uComments
dim busUse
dim appDen
dim theBody
dim myReply
dim defComments
dim theText
dim tmpText
dim theAmount

sub submit_click()
' check all mandatory fields
dim strError
dim appDen

dim ok
ok = true
appDen = ""
strError = "Missing "
if myControls.item("SHARENAME").value = "" and  myControls.item("business").value then
      ok = false
      strError = strError & chr(13) & "Sharename"
end if
if myControls.item("AMOUNT").value = "" and  myControls.item("approved").value then
      ok = false
      strError = strError & chr(13) & "Amount"
end if
if myControls.item("TICKET").value = "" then
      ok = false
      strError = strError & chr(13) & "Ticket"
end if

if ok then
      ' get approved/denied
      if myControls.item("approved").value = true then
            appDen = true
      elseif myControls.item("denied").value = true then
            appDen = false
      else
            msgbox "Select Approved or Denied", 16
            exit sub
      end if
      if myControls.item("business").value = true then
            busUse = true
      elseif myControls.item("user").value = true then
            busUse = false
      else
            msgbox "Select Business or User", 16
            exit sub
      end if

else
      msgbox strError, 16 ' vbcritical
      exit sub
end if
      set myReply = application.createItem(0)
      myreply.Subject = "Ticket #: " & myControls.item("Ticket").value
      theBody = "Support Personnel"
      if busUse then
            if appDen = true then
                  if myControls.item("MB") = true then
                        theAmount = myControls.item("AMOUNT") & " MB "
                  else
                        theAmount = myControls.item("AMOUNT") & " GB "
                  end if
                  theText = replace(reqBusApp,"$SHARENAME$", myControls.item("SHARENAME"))
                  tmpText = replace(theText,"$AMOUNT$", theAmount  )
                  myReply.body = tmpText & chr(13) & theBody
            else
                  theText = replace(reqBusDen,"$SHARENAME$", myControls.item("SHARENAME"))
                  defComments = " "
                  if myControls.item("COMMENTS") <> "" then
                        defComments = chr(13) & "Reason:" & chr(13) & myControls.item("COMMENTS")
                  end if
                  tmpText = replace(theText,"$COMMENTS$", defComments )
                  myReply.body = tmpText & chr(13) & theBody
            end if
      else
            if appDen = true then
                  if myControls.item("MB") = true then
                        theAmount = myControls.item("AMOUNT") & " MB "
                  else
                        theAmount = myControls.item("AMOUNT") & " GB "
                  end if
                  theText = replace(reqUseApp,"$SHARENAME$", myControls.item("SHARENAME"))
                  tmpText = replace(theText,"$AMOUNT$", theAmount)
                  myReply.body = tmpText & chr(13) & theBody
            else
                  theText = replace(reqUseDen,"$SHARENAME$", myControls.item("SHARENAME"))
                  defComments = chr(13) & "Reason:" & chr(13) & uComments
                  if myControls.item("COMMENTS") <> "" then
                        defComments = hr(13) & "Reason:" & chr(13) & myControls.item("COMMENTS")
                  end if
                  tmpText = replace(theText,"$COMMENTS$", defComments)
                  myReply.body = tmpText & chr(13) & theBody
            end if
      end if
      myReply.display true
end sub

sub item_open()
      ' get controls on modified page labeled Approve Increase
dim myInspector
dim myPage
set myInspector = Item.getInspector
set myPage = myInspector.ModifiedFormPages("Approve Increase")
set myControls = myPage.Controls
set myInspector = Nothing
set myPage = nothing

reqBusApp = "Your request for additional storage capacity on  $SHARENAME$ share has been approved, effective immediately, for the $AMOUNT$ increase requested."
reqBusDen = "Your request for additional storage capacity on  $SHARENAME$ share has been denied. $COMMENTS$."
reqUseapp = "Your request for additional storage capacity on your home share (H drive) has been approved, effective immediately, for a $AMOUNT$ increase."
reqUseDen = "Your request for additional storage capacity on your home share (H drive) has been denied. $COMMENTS$"
uComments = "Home shares are limited to 200mb total quota.  If you cannot archive the data on your H drive, you will need to utilize a group share for storing this data"
end sub
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 13

Expert Comment

by:stefri
ID: 10971567
I forget to mention that you have to publish this form in group inbos mailbos and access it from Action/New xxxx where xxx is the name used for publicaation

No fields are created in the folder as the code accesses directly the Controls

Stefri
PS/ I sent an append.oft to you EE mailbox
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10971615
>>cant it be option button as for accept/denied<<
Yes - I'm not committed to the controls...
I'll implement this code tomorrow and let you know.

Thanx for all your help on this! :D
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10971667
How does the oft differ from the code above?
I haven't looked at the code for this form yet, btw.
But I did try the Generate button and it didn't seem to do anything?...
0
 
LVL 13

Expert Comment

by:stefri
ID: 10972208
The OFt is to be published in a folder. It was much convenient for you: you do not have to rebuild the form from scratch
Open the oft, Tools/forms/Publish Form As
Give a ame and select a location: Inbox or whatever
Stefri
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10972390
You're the man stefri. Thanx!!
0
 
LVL 13

Expert Comment

by:stefri
ID: 10972394
you'r welcome
stefri
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10972403
Just curious - how come it doesn't work when not published?
0
 
LVL 13

Expert Comment

by:stefri
ID: 10972426
I was wondering the same...
I suspect that item_open is not fired.
Stefri
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10976647
Stefri - please see:
http:Q_20975821.html
0
 
LVL 67

Author Comment

by:sirbounty
ID: 11007807
Stefri - can I post a "points for" question to you for altering this code to include the comment box at all times (not just denials)?
I've skimmed through it - but I don't want to make it inoperable by 'guessing'...
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now