Cannot remove unwanted fields from form

Status
Not open for further replies.

Hallam Riggs

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hi all,

I'm editing an old form that has been in circulation around our trust for a few years now. It was created around 2004 by someone in the IT department who is long gone from our organisation. When I joined I cobbled together a new version of the form by using a basic knowledge of Outlook. This is now in need of upgrading to a standard beyond my capabilities (and beyond anyone in our IT setup.)

The form is used to request files from a library. The information is filled in, then the form is emailed to the library mailbox. There are 2 tabs - the first for users to put the information of what they require, and the second is information on who they are and how fast they need it.
On the second tab (named 'Information' - pic2) I can edit all the fields and make it work completely for our needs. On the first tab though (named 'Task' - pic1), I cannot remove the fields I do not require, namely 'Start Date', 'Status', 'Prioirty' and '% Complete'.
This is causing problems when trying to simplify our procedures for staff already having to jump through hoops. Anyone know how I can get rid of these?!

Pic1


Pic2
 

Hallam Riggs

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Thanks for your reply Diane.

Is there any way I can hide all of those fields from that page on a print out? They all still appear when I print the task.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
No, not using Outlook's default print functions. You could use a macro to send the fields you want to include in the printout to Word or even to a new outlook message and print.
 

Hallam Riggs

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Well that's gone beyond my range of knowledge! Thanks again for your help though!
 

Hallam Riggs

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Wow, just seen this! This looks excellent - having an issue with that working - is there a version of this code available with all of the default fields already removed, leaving a blank canvas to work on?
 

Hallam Riggs

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hi (again!) Diane!

I put together this last night :):

Code:
Sub PrintTasks()
Dim olTask As Outlook.TaskItem, olMsg As Outlook.MailItem
Dim strBody As String
For Each olTask In Application.ActiveExplorer.Selection
strBody = strBody & olTask.UserProperties("Subject") & vbCrLf & olTask.Body & vbCrLf & olTask.UserProperties("Contact Name") & vbCrLf & olTask.UserProperties("Contact Number") & vbCrLf & olTask.UserProperties("iPM Location") & vbCrLf & olTask.UserProperties("iPM Service Point") & vbCrLf & olTask.UserProperties("iPM Use") & vbCrLf & olTask.UserProperties("Level") & vbCrLf & olTask.UserProperties("Routine") & vbCrLf & olTask.UserProperties("Special Instructions")
Set olMsg = Application.CreateItem(olMailItem)
With olMsg
.BodyFormat = olFormatPlain
.Body = strBody
.Display
.PrintOut
.Close olDiscard
End With
Next
Set olMsg = Nothing
End Sub
A couple of questions (sorry to keep asking - I am quite amateur at this!!!)
How do I keep the field titles? These would be quite useful to us.
How do I direct this to an inbox? It only works on items in my personal tasks. As the task is emailed into our mailbox, it needs to point to that.
Is there any way to add an automatic acceptance of the task into this process as well?
The body does not display a table contained within it. Will it only print as text? Any way I change that?

Thank you so much for your continued help - there is a small corner of South West England that is working much better because of your input!!!
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
1. Write the field's name before its value. It's clearer if you use one line for each field:
strBody=strBody & "Subject: " & olTask.Body & vbcrlf
strBody=strBody & "next field: & ..... & vbcrlf

2. It points to the current selection. If you want to select an email, the olTask variable must be declared As Outlook.MailItem instead of Outlook.TaskItem.

3. Plain text cannot have formattings or a table. Change the format from olFormatPlain to olFormatHtml to keep the table. It could be necessary to format the text then by using html tags. For instance, html cannot display a line break if you write vbcrlf, instead you need to replace it by <br>.
 
Status
Not open for further replies.
Top