Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Convert Word Document Or Text File To BLOB


I am using an Access database as my backend. I am able now to convert image files to BLOB to stor in the access database. I have read a little snippet on covnert a word document to BLOB for SQL, but I am wonder if there is a way to convert a word document on text file to BLOB format and store it in an Access database? Does anyone have any ideas on how to accomplish this?

Thanks, Chester




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Text To Word Document Convert
Dear All,
I have a Richtext box control in my form.Now i want to convert the text in the RTB into a word Document.Now i user the method

VB Code:
RTB.Savefile "C: est.doc",rtftext


But this is not doing any formating.Is there any code avalible to format the contents in the rich text box like Font bold, Paragraph

Text To Word Document Convert
Dear All,
I have a Richtext box control in my form.Now i want to convert the text in the RTB into a word Document.Now i user the method


RTB.Savefile "C: est.doc",rtftext



But this is not doing any formating.Is there any code avalible to format the contents in the rich text box like Font bold, Paragraph

How To Convert Ms Word Document To Pdf File
Good day!

I'm seeking for a solution on how can i convert any existing .doc file to .pdf file using vb 6.0.
Is there any free components or dll's available?
If you any idea please help me

Thanks in advance!

Adding BLOB Files Into A Word Document!
Hello All,

I need to add a BLOB file from an Access 2002 database into a bookmark in a Word document.
I can't do it by just grabbing the BLOB field into a recordset, assigning it to a string and updating the word document with the string inserted.

Is there a secondary or native application I can open the BLOB (fields are called Binary Long Data) first and then copy it into word?

Any other suggestions? Ideally I want to display the BLOB in 35% of it's real size directly...somehow!

Ex. in VB6:
    app.Documents(strDocumentName).Activate
    app.Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst, Count:=1, Name:=""
    If app.ActiveDocument.Bookmarks.Exists(strBookmark) Then ' Selection.Bookmarks.Exists (strBookMark) = True Then
         app.ActiveDocument.Bookmarks(strBookmark).Range.Text = rstGroup2!Picture
   End If

Well I know a BLOB file is not Text but how else can I accomplish this?

Please advise. Thanks for your time!

Maria

Opening A Word Document That Is In A BLOB Field Of A Table From VB
Hi everybody, I need help again. I have to open a word document that is saved in a BLOB field in an Oracle database from Visual Basic, but without downloading the document to disk. Is there anyway to do this? Any options in the sentence Open of the Word.application object?

Thanks

Xtian

Convert A BLOB Type Field From A Database Back Into A File.
I wish to convert a BLOB type field from an Oracle8
database to a bitmap file because it stores bitmap
data. How do I proceed?

Sathyaish.

Convert MS Word To Text File
I am trying to crete a script that will read a line from a MS Word document which the script uses in an if statment.  Using the scipting.filesystemsobject I can do this but it is reading formated text so I get a bunch of characters returned instead of words.  I was wondering if there was a better way to read a word file or is it possible for VBScript to convert a word file to text or even open a word file and save it as a new text file?

Thanks.

Convert Html To Word Docuemtn Using The Word Document Object
i ant in vb6 to open an html page
and convert and save it as word *.doc
how can i do this?
and is it possible to open the html file from the internet with a give url so i will be :
open html document from www..../1.html -> save as 1.doc
thnaks in advance
peleg

How To Covert Doc ( Word Document File ) To Text File
how to convert from *.doc to *.txt file when the user click on a button

 

Convert Word Document To XML
Does anyone know how to convert Word documents to XML?

Convert Html To Word Document
I would like to use either Visual Basic 6 or VBA to convert a html file to a word document. Does anyone have a idea on how to do this? Are their some code examples that demonstrate how to do this?

Extracted BLOB File (.wmf) Inserted Into A Word Doc
Hi all,

Initally I wanted to take BLOB data from my Access database and put it into Word vis VB6. I can now get my BLOB file (which is really a .wmf file) extracted from my database and inserted into my word document. However, just as it gets inserted, my program detects a Type Mismatch error.

The word document is still available and active so I know the .wmf file was inserted properly. However it is 'floating' in my report and not contained in the bookmark I wanted it to be inserted into. And I still have the problem of my program crashing...heh

Any idea why this is all happening? Here is my code:


' I have this somewhere above in my code: On Error GoTo GenerateTemplate_errorhandler which gives me the "Type Mismatch" error msg

Dim MyVisioShape As Shape
Dim mstream As ADODB.Stream
Dim sFullPath As String
                                
sFullPath = strDirectoryName & " emp.wmf" '& rstMacroData.Fields("sFileExtension").Value
app.Selection.GoTo What:=wdGoToBookmark, Name:=conbkmXLDOC_VisioDrawing
app.Selection.HomeKey Unit:=wdLine

Set mstream = New ADODB.Stream
mstream.Type = adTypeBinary
mstream.Open
mstream.Write rstMacroData!Picture.Value
mstream.SaveToFile sFullPath, adSaveCreateOverWrite

Set MyVisioShape = app.ActiveDocument.Shapes.AddPicture(sFullPath, False, True, 0, 0, 143, 266) ' ' THIS IS THE LINE THAT IS PROCESSED BUT THEN DIES!


Please advise if you can. It says it's a Type Mismatch, but I know that it's a .wmf version of a Visio graphic.

Thanks,
Maria

How Do I Convert A Microsoft Word Document To Vb Code?
im sorry for probably such a dumb question but i am a member of the ipaqhq forums and there is a section where you can set up this thing called MY PDA to display all the programs you have in your ipaq.

anyway i was up late lastnight creating one with hyperlinks to all of my software using microsoft word, it took me a couple of hours.

only to find out that it wouldn't post correctly because it need to be vb code.

here is what it is supposed to look like.

http://www.ipaqhq.com/forums/vbgarag...=view&id=12136

i dont want all of that to go to waste so is there a way to convert the word document to vb code?

i have done some searching but i cant seem to find anything on this...

much! much! much! appreciation in advance.

How To Convert Word Document To A Database Field
I am developing a tutorial in which i require to make a table with a field of 80 charecters containg the text. The problem is that i have a large amount of text typed in .doc format i need a code which reads this doc format and place 80 charecters in each record automatically. My database is access

A Button To Convert A Word Document To PDF And Send It By Email --with VB6
Hi there,

I want to add a button to Word to convert the current document to PDF and send it by email to a list of emails I have on an XML file on a remote server.

Is this possible with VB6?

If it is, can you give me some examples/articles on...
1. How to create/add the button itself
2. How to convert the current document to PDF
3. How to read a remote XML file
4. How to send emails

Thank you!!

How To Extract Specific Text From A BLOB File
Hi folks

I have several large BLOB files from a Uniface application which contain text and junk characters.  I need to extract certain pieces of text from the BLOB file.  Is this possible using VBA using either Excel or Access (versions 2003)?

Here is a small portion of one BLOB file:

ENTRY_LINES=SECTION1=N026F005_SECTION=1N026F015_WEEK_NO
=N026F020_TIME_TYPE=WORKN026F022_ALLOW_TYPE=N02
6F025_DATE=20051229N026F030_TIME_FROM=0000000005300000
N026F035_BREAK_FROM=0000000010300000N026F040_BREAK_T
O=0000000011000000N026F045_BREAK_HOURS=N026F050_TIM
E_TO=0000000016000000

In the above example the text "N026F025_DATE=" occurs many times.  I need to extract each instance of that text and the characters after the equals sign (which in most cases are different).

Any hints would be greatly appreciated.

Regards.  Doogster

How To Convert An Html Document To Plain Text?
Read the title thanks

Or how To Parse the source

How To Read A BLOB With An XML-document ?
Hi
How do i manage a BLOB that consists of an XML-transaction ? My issue is to read the BLOB from a database. Each tag is field in the database, so at the end i want to do an insert or update in the same database with the data from the XML-transaction.
/lava



Edited by - lava on 1/27/2004 7:21:54 AM

Convert Blob To String In Visual Basic 6.0
I am trying to convert the blob (binary) to string using stream object in visual basic 6.0. (backend :SQL server 2000) Here is the code i am using...

' To load the Information in the List view ends Here
'Call LoadView
RsFetch.Open StrFetch, Conn, adOpenForwardOnly, adLockReadOnly
If Not (RsFetch.EOF And RsFetch.BOF) Then
Set oStream = New ADODB.Stream
oStream.Type = adTypeBinary
oStream.Mode = adModeReadWrite
oStream.Open
Do While Not RsFetch.EOF
'BlobToFile RsFetch!outliner, gAppPath & "Subbu.txt"
oStream.Write RsFetch.Fields("OUTLINER").Value
oStream.SaveToFile gAppPath & "UPCInput.txt", adSaveCreateOverWrite

'Call ReadAndFormat
RsFetch.MoveNext
Loop
oStream.Close
Set oStream = Nothing


this code is converting from binary to string, but the string contains my expected output as well as special character (some junk values)... How can i convert to string without junk values..... any of you please help in this....

Sample o/p:

f *  Template Information   Status Research   Last Task Employee WENDY KELL   Locator Notes ! ! Upc Label Coded H Product  h Upc 00-00000-00062 

Thanks in advance..
Siva

Insert Text Into A Word Document Text Box From A Vb Form Text Box
Can anyone help me???? im trying to insert text into a word document text box (not one from the control toolbox but the one u get from the insert menu in word) and the source for the text comes from a text box on a vb form.
Ive inserted a document variable field called "joe" into the text box in the document called "doc1.doc" and opening it using a command button using the code below but it wont show the text.

Private Sub Command1_Click()
Dim MyApp1 As Object
Dim MyDoc1 As Object
Set MyApp1 = CreateObject("Word.Application")
Set MyDoc1 = MyApp1.Documents.Open(App.Path & "doc1.doc")
MyDoc1.Variables("joe").Value = Text1.Text
MyDoc1.Fields.Update
MyDoc1.Fields.Unlink
MyApp1.Visible = True
End Sub

this works anywhere else on the document except in the text box.......any ideas??????
doc1.doc is in the same directory as the project.

Insert Text Into Word Document From Vb Form Text Box
hi guys, i want to insert text into word document from a text box on a vb form but i have to be able to specify the place in the document for the text to start. Any ideas?
Thanx in advance

Can Excel Format Be Convert Word Document Format??
can I write the macro that convert the excel data to word?

Convert TextBox's To Text In Word
I have a couple of word documents that are created only with textbox's. Everything 2 or 3 words is a new textbox. Is there a way to convert each textbox to regular text auto on the whole document at once.

For example get the top and left and text of the textbox and then write in the document in the same spot with tabs and spaces like the clikc and type feature does.

Does anyone know, Is this possible?

Thanks for your response.

Postion Text In Word Document From A Vb Text Box
help!!!! i would like to postion text exactly at different positions on one line of a word document.
the source for the text will be 3 different text boxes on a vb form.
i have tried placing the text in the document by inserting 3 document variables into the line but once the text of the first document variable goes into the document it moves the place that i inserted the second document variable and so on with the third.
is there any way i can keep the document variable insertion points where i originally placed them?? or is there any other way i can insert text into a document and specify where i want it to start without using the document variable method??
Any help would be appreciated.
thanx in advance

Text Boxes In VB.net To Word Document
Hello all,

Dont get upset with me, bc i am not very good at programming, but i need to be able to take multiple textboxes (that the user enters data into) and make a new word document with all of the textbox strings in word. The final thing is to take the integer value from a label and put that into the same document as well.

I have looked at all of the code and i cant seem to get it to work properly. i am not sure if it is bc i am using .net or not. any help is greatly accepted!

Thank you.

Writing Text Into Word Document
hallo friends, how I can insert a text in a word-file from my VB6.0 programm ? I use frmB.StartingAddress ="d: est.doc"
to open my word document with the browser.

Put Text Into A Word Document Footer Through Vb
I can't find any option to put text into a footer into a word document that has been created through my program.

Does anybody know how to do this and also to lock the document after it has entered the text?

How To Use Vb To Select Particular Text From Word Document.
I am doing a project for my classes, in which i want to generate paper (randomly), i want to select a sentence from word document which is like this.

#What is simple harmonic oscillation?$

What i want to do is that i am having a word document which is having all the questions starting with # and ending with $ sign, now i want to randomly generate paper for which i have to select the questions from the word document. well exactly how to do that.

Extract Text From Word Document
Hello all, I was wondering if anyone knows how to extract the text from a word document. The format is not important but I wish to reatin the whitespace, (tabs, spaces, newlines).

I've found lots of examples on how to save and create a word document but nothing on extracting text. Thanks for your help.

The Code To Get Text From Word Document
The code to get text from Word document ...?

Capture Text Of Ms Word Document
I want to extract the text of an MS Word document into a vb string.    I found a format description of a 'word for windows 6.0' binary file but the FIB doesn't match a word 97 doc.
I can load an OLE control with the word document and see the text but I can't figure out how to get at it.

Pasting Text Into A Word Document
I am using VB6 and Word 2003.

My issue is with pasting text into a Word document at a specific location. I am creating a cover page that consists mostly of data from a SQL database. One item of the information, the comments, is contained in a separate .RTF file.

So, I want to...
    1. open the database, get the data into variables
    2. Open Word and create a new document that will be the cover page
    3. Begin writing the labels and the corresponding database information on the page
    4. Open the comments .RTF file, copy the contents, paste it into my cover page
    5. Finish the cover page with the remainder of the database info

Everything is fine until I paste the contents of the .RTF file. It doesn't paste in the correct location, it pastes at the top of the document. I'm sure this is something silly but I don't have any real experience automating Word. Here's the code and thanks in advance.

Function CreateCoverPage() As Boolean

  Dim oApp As New Word.Application
  Dim oDoc As Word.Document
  Dim oRange As Word.Range
  Dim oSelect As Word.Selection
  
  Dim oCustCommentDoc As Word.Document
  Dim oCustCommentRange As Word.Range
  Dim oCustCommentSelect As Word.Selection
  
'Code deleted for readability
{...get some info from SQL database into a recordset}
  
  '********************************************************************************
  'Automate MS Word for the cover letter
  '********************************************************************************
  
  'oApp.Visible = True
  
  'Open the CustComment .RTF file, select all contents and copy it for use later
  Set oCustCommentDoc = oApp.Documents.Open("\Serverfileshare" & CustID & "_comments.rtf")
  Set oCustCommentRange = oCustCommentDoc.Range

  oCustCommentDoc.Select
  oApp.Selection.Copy
  
  Set oDoc = oApp.Documents.Add
  Set oRange = oDoc.Range
  
  With oRange
    'Header
    .ParagraphFormat.Alignment = wdAlignParagraphCenter
    .Font.size = 14
    .Font.Name = "Arial"
    .InsertAfter ("ABC Graphics, Inc.")
    .MoveEnd wdParagraph, 1
    .Bold = True
    .Collapse (wdCollapseEnd)
    .InsertParagraphAfter
    
    .InsertAfter SecurityDesc & " information"
    If SecurityDesc = "Confidential" Then
      .Font.Color = wdColorRed
    End If
    .Bold = True
    .Font.size = 12
    .Font.Name = "Arial"
    .Collapse (wdCollapseEnd)
    .InsertParagraphAfter
    
    .InsertAfter "Organization: " & OrgName
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .Collapse (wdCollapseEnd)
    .InsertParagraphAfter
    
    
    .InsertAfter "Cust#: " & CustID & " Date: " & CreationDate
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .InsertParagraphAfter
    
    
    .InsertAfter "Cust name: " & CustName
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .InsertParagraphAfter
    
    .InsertAfter "Addr: " & Addr
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .InsertParagraphAfter
    
    .InsertAfter "City, St, Zip: " & CSZ
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .InsertParagraphAfter
    .InsertParagraphAfter
    



'****************************************************************************************
'Here is the problem. The contents of the .RTF file are pasted at the top of the document instead of after the
'Comments: label
'****************************************************************************************

    .InsertAfter "Comments: "
    With oAbstractRange
      .Collapse wdCollapseEnd
      .Paste
    End With
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .InsertParagraphAfter
    .InsertParagraphAfter
    



    .InsertAfter "DOB: " & DOB
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .InsertParagraphAfter
    
    .InsertAfter "Region: " & Region
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .InsertParagraphAfter
    
    .InsertAfter "JRM#: " & CustJRM
    .Bold = False
    .Font.size = 10
    .Font.Name = "Arial"
    .InsertParagraphAfter
    
  End With
  
  With oDoc
    .SaveAs WORKINGFOLDER & "PDFPCoverPage" & CustID
    .Close False
  End With
  

  oApp.Quit False
  Set oApp = Nothing
  '********************************************************************************


End Function

Find A Word In A Text Document
hi all, I need some help. Urgently I need a template of vba code which searches into a .txt file for a word (e.g. "London") and comes back with the following result: the sentence of where this word is (starting from the word, finishing at the first full stop),each sentence in one line 1. 2. 3. etc respectively. Then I need the program to save this to a table in access.

Thanks a lot for the help

Manolos

Replacing Text In Word Document
I hope this is the right forum. I am using a form in vb that has a print command button. This pulls up a word doc with text from my form's textboxes. It works fine except in this 'if then' instance. I don't understand why it doens't work. When I place a breakpoint in the code and walk through it, I can see with the text tool tip box that my variable has the right text in, but it will not appear on the word document. It is just blank. Can anybody help?
Code:
strlotarea = Text1(12).Text
Set objWdApp = New Word.Application
Set objWdDoc = objWdApp.Documents.Open(FileName:="\Taftgis est.doc")
Set objwdRange = objWdDoc.Content
With objwdRange.Find
  .Replacement.ClearFormatting
  .Text = "lotarea"
  .Replacement.Text = strlotarea        ‘works fine
   .Execute Replace:=wdReplaceAll
        If Text1(6).Text = "R6" Then
        strlotarea = "6,000"
        objwdRange.Find.Text = "lotarea"
        objwdRange.Find.Replacement.Text = strlotarea    ‘left blank on doc.
        objwdRange.Find.Execute Replace:=wdReplaceAll
        End If




Edited by - kpearson on 4/10/2006 10:49:24 AM

Extract Text From Word Document.
Hi,
I would like to write a class in VB 6.0, to extract text content from MSWord documents. Can anyone give me inputs on how to do this ?

Thanks!

How To Read Text Of Word Document
Hello,

I am a newbie to VB. I have a project where I need to search for some words in Word file.

Any pointers on how to do that?

I guess VBA is not the answer. What I plan is read the Word document text, run regular expression on it and extract the words?

Any idea on how to do that?

Adding Text Boxes MS Word Document
I added few text boxes to a MS Word ( version 9) document. When I scroll the document, the text boxes doesn't appear to be moving along with the document. But when I stop scrolling, the text boxes are in proper place. If it is big document and if I am searching for something by moving up and down with scroll bars, it looks messy. It happens only when I am not in design mode ( design mode icon disabled). But if I am in design mode, everything looks OK. Hope, I explained the problem well. Any help is appreciated. Thanks.

Using MS Word To Do Full-text Indexing To A Document.
Hi.

I'm doing an EDMS application and I was wondering if it is possible for a VB application to do a full-text index/search on a document using MS Word?

For example, I scanned a document. Then I do a search using the VB application to search for any document containing the word "certificate". Is it possible for the VB application to use MS Word for this function?

Thanks.

Hot To Read A Text From Current MS Word Document?
Hi Helpers,

My VB application can get a text from any opened and activated windows like as notepad, wordpad and textboxes of other applications.
But I can not get a text from opened and current MS Word document.

How can I get a text from activated MS Word document by using VB application?

Please help me.

Find Text In Textbox In Word Document`
I can find text fine when the text is in part of the basic Word Document using the .FIND, .Execute methods of the Word Document Object, but if the text is in a textbox, I can't find it. Is there a way to do this?

Adding Text Boxes To MS Word Document
I added few text boxes to a MS Word ( version 9) document. When I scroll the document, the text boxes doesn't appear to be scrolling. But when I stop scrolling, the text boxes are in proper place. If it is big document and if I am searching for something by moving up and down with scroll bars, it looks really messy. Any help is appreciated. Thanks.

Paste Text Directly Into New Word Document
I have this code that I got from these forums (can't remember who posted it...sorry ) that pastes text directly into Notepad.
VB Code:
Dim lnghWnd1 As LongDim lnghWnd2 As LongDim sText As String     Clipboard.Clear    Clipboard.SetText Text1.Text        Shell "notepad", vbNormalFocus    lnghWnd1 = FindWindow(vbNullString, "Untitled - Notepad")    lnghWnd2 = GetWindow(lnghWnd1, GW_CHILD)        sText = Clipboard.GetText    SendMessage lnghWnd2, WM_SETTEXT, Len(sText), sText
This works like a champ. What I need to do is modify this to paste the text into a blank word document, so I changed it to this
VB Code:
Dim lnghWnd1 As LongDim lnghWnd2 As LongDim sText As StringDim objWord As Word.a    Clipboard.Clear    Clipboard.SetText Text1.Text        Shell "c:program filesmicrosoft officeoffice11winword.exe", vbNormalFocus    lnghWnd1 = FindWindow(vbNullString, "Document1 - Microsoft Word")    lnghWnd2 = GetWindow(lnghWnd1, GW_CHILD)        sText = Clipboard.GetText    SendMessage lnghWnd2, WM_SETTEXT, Len(sText), sText
However, it does not paste the text into the document. The text is on the clipboard. When the word document opens, if I do a Ctrl-V or an Edit/Paste, the text is copied to the document, but I need it to be there without having to paste it myself.

I don't want the text pasted into an existing document, I need the text pasted into a new, blank, document1, Word document.

How would I do that?

How Can I Extract Text From A Word Document TextBox
i have been working on word Document files.

each document has same text format.

i m using the code below to extract text from it,




Code:


Dim sFileName As String 'Name of files within the folder will be stored
Dim i As Integer 'This will count the files read***
Dim wrd As Word.Application
Dim wrdCount As Long 'Number of characters within the file
'Get the first file with extension "DOC" ***
sFileName = Dir$("C:Virology*.DOC") '***
Do While sFileName <> "" '***
Set wrd = New Word.Application 'Create obj of word application
wrd.Visible = False
wrd.Documents.Open "C:Virology" & sFileName
wrdCount = wrd.Documents(1).Characters.Count
Text1.Text = Text1.Text & vbCrLf & i & wrd.Documents(1).Range(0, wrdCount).Text
wrd.Documents(1).Close
Set wrd = Nothing
sFileName = Dir$ '***
i = i + 1
Loop







This works good for all the characters in the document but the problem rises when word textbox appears in the document.

Copy A Text From A Word Document To A String?
How can I copy a text from a word document into a string?
I have tried, but I can only copy not paste the text into a string?

I want to copy a text from the header in the word dokument. The text I'm coping is from the 11:th cell. How can I do that?

Find/replace Text In Word Document From Vb?
Hi,

I need to be able to automate a find/replace function from within VB for a specific Word document.

For example, I have a document named Document1.doc. There is text in it as follows:

Hi, my name is <NAME>!

From within VB, I want to be able to replace the <NAME> with "Dan".

The values would not come from a database, it will be hard coded, so no need to show any data connectivity code. Just a plain and simple find/replace function.

Any help would be appreciated..

Dan

Adding Text To Exiting MS Word Document
How to Add text from Rich text Box to Ms Word document which the document is fully formated such as tabled etc

Export Text To Table In Word Document
I have an application in VB6 that perform some basic calculations. The calculations themselves are not particularly difficult, but are onerous when you have to repeat them again and again and put the results into a letter. The app works fine.

However, I would like some additional functionality whereby at the click of a button a user could export the results straight from the app into certain cells of a table in the Word document.

The document is a standard template - in other words it will always be the same.

However, i haven't the faintest idea how to approach it. I imagine I could get VB to query the document somehow and then insert data after it finds certain words. Could anybody please point me in the right direction?

Insert Text From VB 6 App Into Open MS Word Document
My wife handles medical dictation and stores some blocks of standard dictation in a text file.  I wrote a small VB app to make searching through the file easier, but she still has to paste the found text from the clipboard (copying to the clipboard from the app is done with one button) into the document.  Is there a way to have the VB app automatically insert text into an open Word document at the point the cursor is?

I searched the FAQs and the post history for something related to this, but didn't find anything that appeared to address this particular thing.

Lee

Opening And Putting Text Into A Word Document!
I can open a word document, BUT....

How do I insert text into it ? I've written the following code, which works up until a point..

Set WordApp = CreateObject("Word.Application")
Set WordDoc = WordApp.Documents.Open("C:Documents and SettingscarlaApplication DataMicrosoftTemplatesStmtTemplate2.dot")
WordDoc.Fields(1).Result.Text = Salutation
WordDoc.Fields(2).Result.Text = Form2.MonthEndData.Fields(1) 'Branch
WordDoc.Fields(3).Result.Text = Form2.MonthEndData.Fields(12) 'Addr1
WordDoc.Fields(4).Result.Text = Form2.MonthEndData.Fields(2) 'Partner etc.....
WordDoc.Fields(14).Result.Text = Format(Form2.MonthEndData.Fields(24) + Form2.MonthEndData.Fields(25), "###,###,###,##0.00") 'MoneyMarket

Set WordRange = WordDoc.Bookmarks("EndOfDoc").Range
stemp = "Product" & vbTab & "CTSBATCHNO" & vbtab & "Product1" & vbTab & "CTSBATCHNO1" & vbCrLf & "1" & vbTab & "2" & vbtab & "1" & vbTab & "2"
WordRange.Text = stemp
WordRange.ConvertToTable vbTab, , , , wdTableFormatColorful2

Cleverly, as I dont know how big the table is, I'd like to insert some text, as in a new line and then send in the next grid. However, everything is ending up in the first grid - not quite what I want.
        
All I want to do, is insert a new heading, with a few blank lines, and then have my new grid appear.

Set WordRange = WordDoc.Bookmarks("EndOfDoc").Range
stemp = "Product2" '& vbTab & "CTSBATCHNO2" &vbtab & "Product3" & vbTab & "CTSBATCHNO3" & vbCrLf & "1" & vbTab & "2" & vbtab & "1" & vbTab & "2"
WordRange.ConvertToTable vbTab, , , , wdTableFormatColorful2

Can anyone please assist ?

Thanks

Copyright 2005-08 www.BigResource.com, All rights reserved