Re: Formating a string to fit the page



On Fri, 18 Jul 2008 08:02:05 -0700, Igor
<Igor@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

If I understand you correctly you need a function like this:
Function WrapText(ByVal strText As String, ByVal intLength As Integer)
As String
Dim i As Integer
Dim strResult As String
For i = 0 To Len(strText) / intLength - 1
strResult = strResult & Mid$(strText, i * intLength + 1,
intLength) & vbCrLf
Next i
WrapText = strResult
End Function

?wraptext("abcdefghijklmnopqrstuvwxyz",10)
abcdefghij
klmnopqrst
uvwxyz

-Tom.
Microsoft Access MVP



Hi can anyone help with formating a string. I am sending one continius string
to the third party software from VBA Third party sofware can does not format
my string to fit the page basicaly it drops everything after certain number
of charachter E.G 125 characters. I can have a long string that is 500-600
charachters does anyone have any functions that would format my string
properly to have 125 charecters on one line and then put CTRLF and continue
printing .

Thanks in advance,
Igor
.



Relevant Pages

  • Search pattern
    ... Dim strfile As String ... Dim bAddressFound As Boolean ... Dim strCurrentChar As String ...
    (comp.databases.ms-access)
  • Auto Write Name and Merge across
    ... Dim Sheetname01 As String ... Dim WeekName01 As String ...
    (microsoft.public.excel.misc)
  • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
    ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
    ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
    (microsoft.public.dotnet.framework.compactframework)
  • Help answer these 70-310 questions
    ... One argument is the string ... Dim output As New StringBuilder ... EmployeeLocations. ... You create a strongly named serviced component. ...
    (microsoft.public.cert.exam.mcad)