hi everyone
i have one grid in my application. i have exported the data to the word file, now i want to export it to notepad. is it possible? if yes then how? i am waiting for the reply. plz help
TIA
6 3654
Hi,
What code u have used to export to Word File?
Try using the same code u use to create txt file..
Regards
Veena
Thanx Veena for your reply
do i need to add any references as i do it for the word document.
my code is -
Dim oWord As word.Application
-
Dim oDoc As word.Document
-
Dim i As Integer
-
-
Set oWord = New word.Application
-
Set oDoc = New word.Document
-
oDoc.PageSetup.Orientation = wdOrientLandscape
-
-
oDoc.ActiveWindow.Selection.Tables.add Range:=oDoc.ActiveWindow.Selection.Range, numrows:=1, numcolumns:=mg3.Cols
-
-
oDoc.Tables(1).Columns(1).Cells(1).Range.Text = "Sn"
-
oDoc.Tables(1).Columns(2).Cells(1).Range.Text = "Name"
-
oDoc.Tables(1).Columns(3).Cells(1).Range.Text = "Address"
-
oDoc.Tables(1).Columns(4).Cells(1).Range.Text = "Tel No"
-
oDoc.Tables(1).Columns(5).Cells(1).Range.Text = "E-mail"
-
-
For i = 1 To mg3.Rows - 1
-
-
oDoc.Tables(1).Columns(1).Cells.add
-
oDoc.Tables(1).Columns(1).Width = 30
-
oDoc.Tables(1).Columns(1).Cells(i + 1).Range.Text = i
-
-
oDoc.Tables(1).Columns(2).Cells(i + 1).Range.Text = mg1.TextMatrix(i, 1)
-
oDoc.Tables(1).Columns(3).Cells(i + 1).Range.Text = mg1.TextMatrix(i, 2)
-
oDoc.Tables(1).Columns(4).Cells(i + 1).Range.Text = mg1.TextMatrix(i, 3)
-
oDoc.Tables(1).Columns(5).Cells(i + 1).Range.Text = mg1.TextMatrix(i, 4)
-
Next i
-
-
oDoc.ActiveWindow.Document.Close True
-
Set oDoc = Nothing
-
oWord.Quit False
-
Set oWord = Nothing
-
Set Db = Nothing
-
-
do i need to change anything in my code. it shows the table, but how i can generate a table in notepad. plz help
i may not need the table in txt file but the data must be shown separated by 'tab'
thanx
Thanx Veena for your reply
do i need to add any references as i do it for the word document.
my code is -
Dim oWord As word.Application
-
Dim oDoc As word.Document
-
Dim i As Integer
-
-
Set oWord = New word.Application
-
Set oDoc = New word.Document
-
oDoc.PageSetup.Orientation = wdOrientLandscape
-
-
oDoc.ActiveWindow.Selection.Tables.add Range:=oDoc.ActiveWindow.Selection.Range, numrows:=1, numcolumns:=mg3.Cols
-
-
oDoc.Tables(1).Columns(1).Cells(1).Range.Text = "Sn"
-
oDoc.Tables(1).Columns(2).Cells(1).Range.Text = "Name"
-
oDoc.Tables(1).Columns(3).Cells(1).Range.Text = "Address"
-
oDoc.Tables(1).Columns(4).Cells(1).Range.Text = "Tel No"
-
oDoc.Tables(1).Columns(5).Cells(1).Range.Text = "E-mail"
-
-
For i = 1 To mg3.Rows - 1
-
-
oDoc.Tables(1).Columns(1).Cells.add
-
oDoc.Tables(1).Columns(1).Width = 30
-
oDoc.Tables(1).Columns(1).Cells(i + 1).Range.Text = i
-
-
oDoc.Tables(1).Columns(2).Cells(i + 1).Range.Text = mg1.TextMatrix(i, 1)
-
oDoc.Tables(1).Columns(3).Cells(i + 1).Range.Text = mg1.TextMatrix(i, 2)
-
oDoc.Tables(1).Columns(4).Cells(i + 1).Range.Text = mg1.TextMatrix(i, 3)
-
oDoc.Tables(1).Columns(5).Cells(i + 1).Range.Text = mg1.TextMatrix(i, 4)
-
Next i
-
-
oDoc.ActiveWindow.Document.Close True
-
Set oDoc = Nothing
-
oWord.Quit False
-
Set oWord = Nothing
-
Set Db = Nothing
-
-
do i need to change anything in my code. it shows the table, but how i can generate a table in notepad. plz help
i may not need the table in txt file but the data must be shown separated by 'tab'
thanx
Hi,
Notepad dosent support Tables, so, u will have to use Tabs or ; or | or Special Character and make look like Tables,
use File IO to export to txt file. For this, u dont need any references..
REgards
Veena
Could you please give me some hint how can i use File IO, or could you plz give me some code snippet on how to export to txt file.
thanx once again
Hi,
This is just basic File Handling in VB6:
No references needed.. -
Dim FN As Long
-
FN = FreeFile
-
Open "C:\MyTextFile.txt" For Output As FN
-
Print #FN, "This Is My First Line From VB6"
-
Print #FN, "This Is My Second Line From VB6"
-
Close FN
-
MsgBox "Check Text File C:\MyTextFile.txt"
-
Regards
Veena
Sign in to post your reply or Sign up for a free account.
Similar topics
by: DarkSpy |
last post by:
many c++ compilers including "gcc" have not implemented the "export"
keyword, but the comeau compilers made it (just i knew).
i want to know about: is it too difficult to implement "export"...
|
by: Shawn Mehaffie |
last post by:
I have the following class that I've wirtten to take a Dataset and
automatically export it to either XML, ASCII or Tab delimited file. The
reason I wrote it they way I did was that I don't want to...
|
by: Jeremy Siek |
last post by:
CALL FOR PAPERS/PARTICIPATION
C++, Boost, and the Future of C++ Libraries
Workshop at OOPSLA
October 24-28, 2004
Vancouver, British Columbia, Canada
http://tinyurl.com/4n5pf
Submissions
|
by: maricel |
last post by:
Is there anybody out there who have any idea why EXPORT is relatively slower
when putting the output file on a network drive - map drive from onother PC
compared to putting it on my local PC drive...
|
by: Tim Eliot |
last post by:
Just wondering if anyone has hit the following issue and how you might
have sorted it out.
I am using the command:
DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True
after...
|
by: Shawn Mehaffie |
last post by:
I have the following class that I've wirtten to take a Dataset and automatically export it to either XML, ASCII or Tab delimited file. The reason I wrote it they way I did was that I don't want to...
|
by: chaitu |
last post by:
Hi,
Can anybody tell me what the error code for Export is. Like i get the
message
SQL3104N The Export utility is beginning to export data to file...
|
by: Steven T. Hatton |
last post by:
<quote
url="http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=53&rl=1">
exported Templates
Last updated Sep 6, 2006.
exported Templates
The separate compilation model enables...
|
by: NEWSGROUPS |
last post by:
I have data in a table in an Access 2000 database that needs to be exported
to a formatted text file. For instance, the first field is an account number
that is formatted in the table as text and...
|
by: iheartvba |
last post by:
Hi I am using Access 2007 and am trying to export a query to a fixed length text file. I tried using the following code to export the text file:
DoCmd.TransferText acExportFixed, , "qryFFRDeFile",...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
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...
|
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...
|
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |