Strange behaviour with Outlook Message field

C

chris a

hi all

after repeatedly storming out of the office in frustration and taking
up smoking again down the back alley i've decided to seek advice from
you all for a really frustrating Outlook 2003 SP1 problem.

i've created a custom form on the Compose Page of a mail message which
allows our client firms to enter data into fields and then submit to
us. Outlook then plugs these fields into a file and attaches it to the
email for me to further manipulate at my end.

the problem is that the Message field on the Read Page of the returned
email loses all functionality and sets itself into this read-only state
where you can't even copy and paste data from it. since this is where
the attachment is attached it's also impossible to get at the file.

but it's not just my form this is happening to. if i even make minor
adjustments to the Message field of a default Mail form (say, resize
it), publish and run it, the received Message field exhibits the same
behaviour as explained above.

this should be a REALLY simple thing to do in Outlook. can anyone shed
some light on this?

thanks in advance.

chris
 
H

Hollis D. Paul

the problem is that the Message field on the Read Page of the returned
email loses all functionality and sets itself into this read-only state
where you can't even copy and paste data from it. since this is where
the attachment is attached it's also impossible to get at the file.
Is there any reason to be using a split form in your case? It sounds
like you did not construct the controls on the read page properly, and so
they are not hooked to the controls on the compose page. If you do not
have a specific reason to use a split form, then don't, and life will be
a lot easier.

Don't blame your smoking restart on Outlook problems. If it wasn't
Outlook you were frustrated with at that moment, it would have been
something else. You restarted smoking because you were not being
absolutely clear to yourself that you would not respond to the cravings.
Instead of storming into the back alley, you should be calling a quit
hotline. Remember, your kids are telling you to quit to live!

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Mukilteo, WA USA
 
C

chris a

thanks for reply hollis.

to be honest outlook isn't somewhere i've considered programming before
- i'm a database programmer by design. my department need to use this
method for our current situation though, and well, as the only sole
with half a know-how i put my hand up to do it.

i figured that the user would enter data into the Compose side of the
form, the code would bundle that data into a CSV file, attach it, send,
then i could snatch it from the Read side of the form.

how else would you suggest doing this without using a split form? (i'm
assuming split form means to use the Compose/Read aspects). i just
tried dumping the fields into a separate tab, with a Message field, and
alas when i go to read the email the Message field is still
mysteriously locked - even though it's the only one on the form.

cheers
chris
the problem is that the Message field on the Read Page of the returned
email loses all functionality and sets itself into this read-only state
where you can't even copy and paste data from it. since this is where
the attachment is attached it's also impossible to get at the file.
Is there any reason to be using a split form in your case? It sounds
like you did not construct the controls on the read page properly, and so
they are not hooked to the controls on the compose page. If you do not
have a specific reason to use a split form, then don't, and life will be
a lot easier.

Don't blame your smoking restart on Outlook problems. If it wasn't
Outlook you were frustrated with at that moment, it would have been
something else. You restarted smoking because you were not being
absolutely clear to yourself that you would not respond to the cravings.
Instead of storming into the back alley, you should be calling a quit
hotline. Remember, your kids are telling you to quit to live!

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Mukilteo, WA USA
 
C

chris a

okay, i just tried changing the form so that it doesn't have a separate
Read layout and the Message control is _still_ playing hard to get.
i'm completely confused how something so simple could cause so much
trouble.
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75152

okay, i just tried changing the form so that it doesn't have a separate
Read layout and the Message control is _still_ playing hard to get.
i'm completely confused how something so simple could cause so much
trouble.
You said this about your form: "the problem is that the Message field on
the Read Page of the returned email loses all functionality and sets
itself into this read-only state where you can't even copy and paste data
from it. since this is where the attachment is attached it's also
impossible to get at the file."

You should not be trying to make an attachment to the Message field. You
add a file to an Outlook data Item by getting the Attachment collections
object, using the Add method to add an attachment object to the
collection. I do not get the feeling that you are doing anything like
that. You should go to www.slipstick.com, and/or www.outlook-code.com
and look for an example of adding an attachment to an Outlook data Item.

You also get good examples out of the code editor help file. Actually,
my article on Automating Tip posting to my SharePoint site contains
script in a custom form that attaches a file to an Outlook Item and mails
it to a Exchange Public Folder. You could look at that if you don't find
a better example at the aforementioned sites. The URL to the coding
article is:

http://msmvps.com/blogs/obts/articles/71693.aspx

Automating Tip Capture with Office Systems 2003 - Part 2
All you ever wanted to know about the code

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Mukilteo, WA USA
 
C

chris a

Thanks for the replies Hollis.

I have been attaching the document using Item.Attachments.Add, actually
from examples on www.outlook-code.com (see below). I was refering to
the Message field because that's where the attachment ends up. And
that's where my problem lies. Outlook is acting so sporadically - like
my first message said even just slightly modifying a default Mail
message causes the received Message field into lock-down where, for
instance, all right-mouse-click options are greyed out, nothing can be
copied from and even the mouse scroll won't work. When composing the
email the Message field does not exhibit this behaviour.

Have you come across this sort of behaviour before?

------------------------
' Create object to hold the attachment
Set objFSO_M = Application.CreateObject("Scripting.FileSystemObject")

' Get the temporary Windows folder where attachment is stored
Set objFolder_M = objFSO_M.GetSpecialFolder(2)

' Define CSV file and path
strTempFile_M = "NewOpportunity.csv"
strTempFile_M = objFolder_M.Path & "\" & strTempFile_M

' Write data to file
Set objStream_M = objFSO_M.CreateTextFile(strTempFile_M, True)
objStream_M.WriteLine '...... write lines of data'
objStream_M.Close

' Attach document
Item.Attachments.Add strTempFile_M, olByValue
------------------------
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75165

objStream_M.Close
Does this do a save function, also? The file has to be saved before it
can be attached.
Outlook is acting so sporadically - like
my first message said even just slightly modifying a default Mail
message causes the received Message field into lock-down where, for
instance, all right-mouse-click options are greyed out, nothing can >
be copied from and even the mouse scroll won't work.

Be sure to do all your customizations on a back tab of the form.
Customizations of the first page can cause all kinds of strange
behavior, depending upon the form being customized.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Mukilteo, WA USA
 
C

chris a

Well, I have it working.

After playing around with a default Mail message I've found that the
reply's Message field can only be properly accessed if the cursor is
placed in another field first, such as Subject or From. If I then move
it to the Message field and the cursor blinks, only THEN will it behave
properly. If the cursor isn't blinking, then too bad, keep clicking
around the form until it does. This _really_ stinks, but after many
anguished moments at least it's working. I can quit smoking again now
;)

Thanks for your efforts Hollis.

Chris.
 
H

Hollis D. Paul

<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: h-68-167-254-208.sttnwaho.dynamic.covad.net 68.167.254.208
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
Lines: 1
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:75175

This _really_ stinks, but after many
anguished moments at least it's working. I can quit smoking again now
Glad to here it is working well enough. Custom forms are indeed very
tricky.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Mukilteo, WA USA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top