Copy contents of a field does not copy complete field

S

Sandy

I have an EventProcedure to go to a field and copy the contents. The first
part copies the text, then the Notify Macro is a Send Object Macro. The idea
is to have the text from the ResumeTXT field in the Clipboards so it can be
pasted into the Message of the Email.

Trouble is that this either crashes the database, or only copies part of the
field. If I tab out and back into the field, then do the Ctrl-C to copy, all
the text is there when I paste. I have tried running this without the last
RunMacro command and it still does not copy everything when I paste it in
Notepad.

Sometimes the data in the field is long as it is one field and 2 memo fields
concatenated:
ResumeTXT =[NotifyMessage] & Chr$(13) & [coverletter] & Chr$(13) & [Resume]

If I remove one or two of the fields it seems to work - must be an issue
with the length of the text.

I have tried sending a report with these fields using the SendObjects
command but this does not send the complete report either. It inserts a bunch
of returns in the middle of the document and cuts off the end.

I am at a loss. Any ideas greatly appreciated.

-------------

Private Sub CopyField_Click()

ResumeTXT.SetFocus
ResumeTXT.SelStart = 0
ResumeTXT.SelLength = Len(ResumeTXT)

DoCmd.DoMenuItem 1, acEditMenu, 2

DoCmd.RunMacro "Macros.Notify"

End Sub



Thanks!
Sandy
 
A

Allen Browne

How much text is in this control?

SelLength is an integer, so anything beyond 32k characters won't be copied.
The text box handles 64k characters. Does this explain what you are seeing?

An alternative would be to use an API call to copy the text to clipboard:
http://allenbrowne.com/func-07b.html
 
S

Sandy

I removed the follwoing lines from the script and now it works!

ResumeTXT.SelStart = 0
ResumeTXT.SelLength = Len(ResumeTXT)

Thanks
sandy

Allen Browne said:
How much text is in this control?

SelLength is an integer, so anything beyond 32k characters won't be copied.
The text box handles 64k characters. Does this explain what you are seeing?

An alternative would be to use an API call to copy the text to clipboard:
http://allenbrowne.com/func-07b.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Sandy said:
I have an EventProcedure to go to a field and copy the contents. The first
part copies the text, then the Notify Macro is a Send Object Macro. The
idea
is to have the text from the ResumeTXT field in the Clipboards so it can
be
pasted into the Message of the Email.

Trouble is that this either crashes the database, or only copies part of
the
field. If I tab out and back into the field, then do the Ctrl-C to copy,
all
the text is there when I paste. I have tried running this without the last
RunMacro command and it still does not copy everything when I paste it in
Notepad.

Sometimes the data in the field is long as it is one field and 2 memo
fields
concatenated:
ResumeTXT =[NotifyMessage] & Chr$(13) & [coverletter] & Chr$(13) &
[Resume]

If I remove one or two of the fields it seems to work - must be an issue
with the length of the text.

I have tried sending a report with these fields using the SendObjects
command but this does not send the complete report either. It inserts a
bunch
of returns in the middle of the document and cuts off the end.

I am at a loss. Any ideas greatly appreciated.

-------------

Private Sub CopyField_Click()

ResumeTXT.SetFocus
ResumeTXT.SelStart = 0
ResumeTXT.SelLength = Len(ResumeTXT)

DoCmd.DoMenuItem 1, acEditMenu, 2

DoCmd.RunMacro "Macros.Notify"

End Sub



Thanks!
Sandy
 

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