Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrap Pasted Text In Attacmate 1

Status
Not open for further replies.

DizzyP

Technical User
Feb 27, 2012
26
US
I constantly paste from Outlook to Attachate. If the cpoied text is longer than the space available in Attachmate it does not continue to the next line. I want to write a macro that will wrap the text. My idea was to use the screen coordinates and maybe loop it. I am very new to VB so thank you in advance for bearing with me.
 
My appologies. I don't understand vb enough to explain what it's doing. I appreciate the help and patience, but I have taken on something that is above my head. Thank you again for the help Skip.
 


Do you understand what I posted previous to you last post?

INFORMATION not meaningless hand wringing.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
yes I understand.
DizzyP said:
Again, thank you!!! I was able to get it to work with that logic. I was able to tweak it to make it start on the cursor so if the macro is run more than once it doesn't replace the previous.


Code:
iColStrt = Sess0.Screen.Col          
iRow = Sess0.Screen.Row              
iNbrCols = 75                    
iColNxt = iColStrt + 1              

parseStart = 1                          
parseLen = iNbrCols - iColStrt          
iCol = iColStrt                         
    
   Do While parseStart < Len(stuffToPaste)
    
  Sess0.Screen.PutString Mid(stuffToPaste, parseStart, parseLen), iRow, iCol
      parseStart = parseStart + parseLen
      parseLen = iNbrCols - iColNxt                          
      iCol = iColNxt                                          
      iRow = iRow + 1                                     
    Loop
    
    Sess0.Screen.MoveTo iRow, iCol
My challenge now is to figure out where to place the
Code:
InStr(70, stuffToPaste, " ")
to keep the words from cutting in half when wrapping.

I've placed the InStr in multiple places. What I remember doing is making parseStart = InStr(70, stuffToPaste, " ") and that leaves me with an "invalid function".

I would like to use Instr() if it will work for this because I'm not comfortable with arrays. That is why I was asking if it will work to accomplish the same result as Split().
 


InStr() ONLY tells you where a string is in a string.

You must use the MID() function to pick apart the string. You can look at my SplitIt() function to see how I did that.

FYI, when you refer to some piece of code, then post that piece of code. It is not sufficient to make an implicit reference to something posted earlier that very well could have been changed.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I see your split function, but I don't understand it. I don't get what the variables are and what they are doing. Will this just work if I call it with the code I have and leave it (the function) as is?
 


Tell me what you do not understand.

SplitIt() returns an ARRAY. Here's an example:
Code:
    Dim x, ind As Integer

    x = SplitIt("Now is the time!", " ")

    For ind = 0 To UBound(x)
        Debug.Print x(ind)
    Next


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Found a setting for it in attachmate...no need for the macro. I overlooked it before. Thank you though. I have learned a lot from this experience!!!
 


Please share your solution with other members.

Tek-Tips is not a one way street.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top