Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Vbtab - Not working

Posted on 2003-03-29
19
Medium Priority
?
727 Views
Last Modified: 2013-11-13
Hi
Iam generating email thru' V.basic-6.0 using winsock
And formatting the message body using 'vbtab'.
'vbcrlf' is working but 'vbtab' does't show any effect to the message body.

Example:
       msgbody = variable1 & vbtab & varaible2

When msgbody is directed to email , it shows as below
       variable1variable2

But I would like to have the result as
       variable1      variable2    

Suggestion pls...

Thanks
Deva
0
Comment
Question by:deva_rajesh
  • 6
  • 4
  • 2
  • +5
19 Comments
 

Expert Comment

by:Reggie_BE
ID: 8229829
and can't you replace vbtab by some spaces ?

& space(10) &
or just try tab(1) ;)
0
 

Author Comment

by:deva_rajesh
ID: 8229840
Hi
using space() creates space but does't work as tab ..
tab(1) is not working
Deva
0
 

Expert Comment

by:Reggie_BE
ID: 8229847
and SendKeys ("{TAB}") ?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:deva_rajesh
ID: 8229876
Giving me the error

expected function or variable

Deva
0
 
LVL 3

Expert Comment

by:DocM
ID: 8229966
Hi,
Use a function to format the width of the variables before printing:

Function FormatWidthOf(var1, myWidth) As String

    FormatWidthOf = CStr(var1)
    While Me.TextWidth(FormatWidthOf) < myWidth
        FormatWidthOf = " " & FormatWidthOf
    Wend

End Function

Private Sub Command1_Click()
    Me.Font = Text1.Font
    Me.FontSize = Text1.FontSize
    Text1.Text = ""

    myWidth = Me.TextWidth("01234567890")

    var1 = 123.45
    var2 = 6.78
   
    Text1.Text = Text1.Text & FormatWidthOf(var1, myWidth) & FormatWidthOf(var2, myWidth) & vbCrLf

     
End Sub
0
 
LVL 5

Expert Comment

by:avya2k
ID: 8230046
better use
msgbody = variable1 & chr(9) & varaible2
0
 

Author Comment

by:deva_rajesh
ID: 8236742
hi , its somewhat ok, but not creating space as exactly as vbtab does.
0
 

Author Comment

by:deva_rajesh
ID: 8236745
chr(9) is also giving no effect
0
 
LVL 3

Expert Comment

by:Barca
ID: 8252001
umm

""& variable1 &"" & vbtab & ""& varaible2 &""
0
 
LVL 5

Expert Comment

by:avya2k
ID: 8258837
vbtab and chr(9) is one and the same

what method u r using or in what control you are formatting your msgbody
0
 

Author Comment

by:deva_rajesh
ID: 8258934

 ""& variable1 &"" & vbtab & ""& varaible2 &"" 

I hv to use quotation mark or something else ?

0
 

Author Comment

by:deva_rajesh
ID: 8258971
HI i thinkg the content type should b changed

I use

Call SendData(mysock, "Content-Type: text/html; charset=ISO-8859-9" & vbCrLf)

Should i change this to something else?
0
 
LVL 3

Expert Comment

by:Barca
ID: 8259252
umm....i don't know what type of varaible 1&2 are,

but i suggest change it to string first.

str(varaible1) & vbtab & str(varaible2)
0
 
LVL 5

Expert Comment

by:avya2k
ID: 8259274
if you have set content type to html or your mailbody is in html format then you can not insert tab by chr(9) or vbtab
you have to do it like this

variable1 & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & varaible2

&nbsp; = one space
0
 
LVL 5

Expert Comment

by:avya2k
ID: 8259285
this is how one should insert more than one space characters in HTML
0
 
LVL 3

Expert Comment

by:DocM
ID: 8261880
If you use the <PRE> </PRE> tags, you don't need &nbsp; to insert spaces. The text between <PRE> and </PRE> will appear as is.

<html>
<TITLE></TITLE>
<BODY>
<PRE>

   AIM Global Technology           $    10.8320      
   AIM Global Health Sciences Cla  $     5.7070      
   AIM RSP European Growth         $     3.9730  
   
</PRE>

</BODY>
</HTML>
0
 

Expert Comment

by:CleanupPing
ID: 8531376
Hi deva_rajesh,
This old question (QID 20567247) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9440751
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->PAQ - no points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9495570
This question is PAQed and no points refunded (of 500)

YensidMod
Expert Exchange Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question