Select two lines, return as one line 
Author Message
 Select two lines, return as one line

I want to set a variable based on a selection of two lines of text separated
by a paragraph mark, however the variable would be the line one and line two
concatentated (i.e., no paragraph mark).

Any ideas?

Much appreciated



Tue, 02 Dec 2003 03:44:14 GMT  
 Select two lines, return as one line
Hi JasonM,

Quote:
> I want to set a variable based on a selection of two lines of text separated
> by a paragraph mark, however the variable would be the line one and line two
> concatentated (i.e., no paragraph mark).

I assume this is Word...

What version of Office?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Wed, 03 Dec 2003 03:10:58 GMT  
 Select two lines, return as one line

Hi JasonM,

Don't forget to include some more info when posting:
Like:
MS Word, Off97, NT4
(or whatever)
Could make a difference ...

Getting back to your question:
Assumptions: Word2K and you've concatenated two lines into
variable 'OneLiner'; oneliner has this paragraph mark.Chr(13)

Dim sLeftPart As String
Dim sRightPart As String
Dim arrTemp
Dim MyNewLine As String

'determine parts left and right off paragraph mark, using Split function
arrTemp = Split(OneLiner, Chr(13), 2)
sLeftPart = arrTemp(0)    'left part off delimiter
sRightPart = arrTemp(1)    'right part off delimiter

'There you go
MyNewLine = sLeftPart & " " & sRightPart

Kind regards,
Perry



Quote:
> I want to set a variable based on a selection of two lines of text
separated
> by a paragraph mark, however the variable would be the line one and line
two
> concatentated (i.e., no paragraph mark).

> Any ideas?

> Much appreciated



Wed, 03 Dec 2003 15:30:57 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB 4.0 : Two commands on one line of code

2. Two .jpg Images on one Line.

3. returning value of selected line in listbox

4. Select Only one line in a grid?

5. How to display one record on one line in a listbox

6. writing more than one vbscript statement in one line

7. Recordset returns one of two specifications (?)

8. How to get two return values from one fuction

9. Macro with Two Application.PrintOut FileName lines fails on second instance

10. Two lines of sql

11. Are these two lines the same?

12. Two lines of sql

 

 
Powered by phpBB® Forum Software