Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I copy specific text from a document in edit mode and add it to the subject line?
    text
    copied!<p>I'm far from an expert, but I've learned quite a little bit about using the Lotus @Formula language recently and have created some very useful buttons for myself. Unfortunately, I'm having trouble trying to put the finishing touch on one I recently created and no matter how much searching I do, I can't seem to find anything to point me in the right direction.</p> <p>To be more specific, what I'm trying to do is forward a note that takes a piece of text from the body of the email and uses it in the subject line. The note that I'm forwarding could either be a memo or a document from a specific database. When I forward a document from the database, I can get the text I need by getting the value of a specific field before it forwards it by using <strong>@GetField</strong>. If I'm only forwarding directly from a document from the database, it works perfectly by first getting the value, which is good because once I open that new memo to forward it, that field is no longer there.</p> <p>The problem is that if I'm forwarding someone else's email (someone who already forwarded a document from the database), I have no opportunity to first get the value I need because that field is already gone. The good news is that the value of the field I'm trying to get is listed in a table of the memo that I'm forwarding. Unfortunately, I can't figure out how to get that text highlighted and copied so I can have it pasted in the subject line. In my simple mind, I'm thinking I just need a way to "find" the static text that precedes the text I need to copy, move one space to the right, and highlight and copy everything from that point to the end of the cell.</p> <p>Basically, I need a way to find and copy something from the body so I can use it in the subject line. The closest thing I could get to work is to move the cursor to the spot by using <strong>EditDown</strong> and <strong>EditRight</strong> commands. The problem with that method is that I have no way of knowing the correct number of lines to move down. If I were forwarding the original document, the following sort of works:</p> <pre><code>@Command( [EditGotoField]; "Body" ) ; REM "The next line only works if the text is located exactly 33 lines down." ; @Command( [EditDown]; "33" ) ; @Command( [EditRight]; "29" ) ; @Command( [EditDeselectAll] ) ; REM "The next line only works if the text I need is three characters long." ; @Command( [EditRight] ; "3" ) ; @Command( [EditCopy] ) ; @Command( [EditGotoField] ; "Subject" ) ; @Command( [EditSelectAll]) ; @Command( [EditInsertText] ; "The text I need is: " ) ; @PostedCommand( [EditPaste] ) </code></pre> <p>I say "sort of" because the part where it selects text only works if the text I need happens to be the same number of characters that I've specified in the code. If the text I need is longer, it won't get it all. If it's shorter, the cursor selects the next cell and then copies a bunch of unnecessary text. I need a way to make it only select to the end of the cell (i.e. as if hit 'Shift' + 'End').</p> <p>I thought maybe I could call an agent to perform this piece, but I couldn't find anything helpful in my searches for LotusScript.</p> <p>I also thought that maybe the email I'm forwarding might have some link back to the original document, but I'm unable to find anything. My thinking was that maybe it could find the original document, get the value I need and go back to the note.</p> <p>Thanks for taking the time to read this. If anyone can help, I'd really appreciate it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload