473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Preview & print in Dos Mode Using VB 6.0

Hi,

I have a flexgrid with few data. Now I want that to be print in DOS Mode (To be print on Notepad), Preview it for the user and prevent the user from modifying the data in it. Is there any Idea to implement this.. ?

My Code is as follows:
-------------------------------------------------------------------------
Private Sub cmdPrint_Click()
stat = "PRINT"
Open App.Path & "\ProductList.txt" For Output As #1
Write #1, Space(5) & "Company Name"
Write #1, Space(5) & "Address1" & Space(15 - Len("Address1")) & vbTab & "Address2"
Write #1, Space(5) & "City" & Space(20 - Len("City")) & "Ph: 22222222"
Write #1, "------------------------------------------------------------------------------------------------------"
Write #1,
Write #1, Space(5) & vbTab & "Products List"
Write #1, Space(5) & vbTab & "--------------------"
Write #1,
rws = msfProductsList.Rows - 2
i = 1
Do Until rws = 0
msfProductsList.Row = i
msfProductsList.Col = 1
prodlist = Trim(msfProductsList.Text) & Space(4 - Len(Trim(msfProductsList.Text)))
msfProductsList.Col = 2
prodlist = prodlist & vbTab & Trim(msfProductsList.Text) & Space(10 - Len(Trim(msfProductsList.Text)))
msfProductsList.Col = 3
prodlist = prodlist & vbTab & Trim(msfProductsList.Text) & Space(50 - Len(Trim(msfProductsList.Text)))
msfProductsList.Col = 4
prodlist = prodlist & vbTab & Trim(msfProductsList.Text) & Space(10 - Len(Trim(msfProductsList.Text)))
msfProductsList.Col = 5
prodlist = prodlist & vbTab & Trim(msfProductsList.Text) & Space(10 - Len(Trim(msfProductsList.Text)))
msfProductsList.Col = 6
prodlist = prodlist & vbTab & Trim(msfProductsList.Text) & Space(10 - Len(Trim(msfProductsList.Text)))
msfProductsList.Col = 7
prodlist = prodlist & vbTab & Trim(msfProductsList.Text) & Space(10 - Len(Trim(msfProductsList.Text)))
msfProductsList.Col = 8
prodlist = prodlist & vbTab & Trim(msfProductsList.Text) & Space(10 - Len(Trim(msfProductsList.Text)))
Write #1, prodlist
rws = rws - 1
i = i + 1
Loop
Close #1
MsgBox "Printed Successfully"
End Sub
----------------------------------------------------------------
And I ve attached a Text File, which is output im getting...
Jul 18 '08 #1
0 1300

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Eager-Learner | last post by:
Through window.open or window.showmodaldialog, I want to open a word or excel document in Print Preview mode. Bcos I don't want the user to make any changes or save it but the user can ONLY VIEW OR...
7
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
1
by: sea | last post by:
I have Access 2002 and I am writing this application with a custom menu bar that has a print preview button -- the start up options hide the design window. The problem is that when an open form is...
2
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002...
4
by: Gary | last post by:
Hello, I'm hoping someone can shed some light on why my report does not output the same results as shown in preview mode, which is to move the position of a check box based on a field value (see...
9
by: igotyourdotnet | last post by:
I need to create a print preview page BUT my page I need to print has a grid and in the grid I have 2 or 3 columns that have links I want to hide the columns with the links on my print preview page...
2
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
0
by: eighthman11 | last post by:
Using Access 2003. I have a command button that does a print preview for a report. The command button runs a stored procedure on the SQL server. Stored procedure runs very quick. When the...
4
by: scubasteve | last post by:
I've developed a product pricing application for a client in AC2007. They enter all the data on the one main form, then click a button to open a printable report in Print Preview. My problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.