Generate a word doc

gdanalakshmi

Registered User.
Local time
Today, 14:47
Joined
Nov 26, 2002
Messages
102
I am using VBA to create a Word Document.

I want to insert a hypertext string into the Word document.
How Do I create a new file(a new Word document) with the string inserted into it??

Advanced Thanks
Lakshmi
 
Not too sure on how to insert into a word doc.
The code below will create a new .txt file called flag.txt and insert a line of text into it.
It may help.
Code:
    Dim fs, a

    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.CreateTextFile(DirStr & "Flag.txt", True)
    a.WriteLine ("Do Not delete this file.")
    a.Close
    Set fs = Nothing
    Set a = Nothing
 
I had several problems trying to generate a word document from an Access database. In the end I turned it on it's head and created a macro using VBA within word to pull the information I wanted from the relevant database. Doing it this way makes it easier to format the document using bookmarks etc..
 

Users who are viewing this thread

Back
Top Bottom