|
-
Nov 20th, 1999, 09:59 PM
#1
Thread Starter
Junior Member
it's all in the subject above...
-
Nov 21st, 1999, 01:14 AM
#2
Guru
spandex44: Nope - if DOC files were normal text files, how could you get the formatting? The files are in binary format.
This is how to (for example) copy Text1.Text to C:\Text1.Txt...
Code:
Dim nFile As Byte
If Len(Dir("C:\Text1.Txt")) <> 0 Then
If MsgBox("The file already exists! Would you like to overwrite it?", vbQuestion or vbYesNo, "File Exists") = vbNo Then
Exit Sub ' Exit Function, Exit Property, Exit Room, Exit World, Exit Whatever
End If
End If
nFile = FreeFile
Open "C:\Text1.Txt" For Output As #nFile
Print #nFile, Text1.Text
Close #nFile
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
AIM: RYoni69
-
Nov 21st, 1999, 01:54 AM
#3
Hyperactive Member
Take a look at this post:
http://www.vb-world.net/ubb/Forum1/HTML/007402.html
You'll have to pre-format your Word Doc the way you want it to look, with fonts, spaces, etc., even tables. Name each field as "Position1", "Position2", etc.
In your VB app you'll have any number of text boxes, option boxes, whatever you like.
Then you insert all this stuff into Word, which works in back-ground, and each field will go neatly into the corresponding position. Then you can either print or save your Word Document.
If you need more help, re-post here.
Regards, JuanCar
[This message has been edited by Juan Carlos Rey (edited 11-21-1999).]
-
Nov 21st, 1999, 12:33 PM
#4
Guru
Maybe a silly answer: Use Microsoft Word... Sorry, impossible otherwise (without getting sued???).
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
AIM: RYoni69
-
Nov 22nd, 1999, 04:16 AM
#5
I think the best way(in my opinion) to deal with files like .xls, .doc is to use their native applications as OLE servers and manipulate the content using the Applications native methods. The only drawback is that you must have the application installed on your system and make sure you have the correct version.
Look these up:
1. Word help files under OLE
2. Vb help files under CreateObject()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|