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




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




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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

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

Opening Word Document From Excel When The Word Document Is Read Only
I'm trying to open a Word document from Excel and have hit a snag. The file I'm trying to access is Read-only and the code stops when the "This file is read-only..." prompt displays. How do I get past this? Here's the code that I have so far (thanks to some help from this forum):

Code:
Sub OpenAndPrint()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim stPathName As String

stPathName = Range("B4").Hyperlinks(1).Address

If Dir(stPathName) <> "" Then
Set wdApp = New Word.Application
wdApp.Visible = True
wdApp.DisplayAlerts = wdAlertsNone 'Tried to turn off the prompt, but it didn't work.
Set wdDoc = wdApp.Documents.Open(stPathName) 'Code stops here and waits for the user to respond to the prompt.
Set wdDoc = Nothing
Set wdApp = Nothing
Else
MsgBox "The file does not exist!", vbInformation
End If

End Sub

Reading The Word Document From Visual Basic Without Opening The Word Applicaiton
Hi

I need to access the word document from visual basic without opening the word application. I can do this by opening the word application. Is there any other way to read a document from vb.

I need to search for a particular word in the document without opening the word application.

Waiting for your reply,

thanks

Mohan

Opening A Word Document With Word From Excel
i want to have a part of an excel macro where it opens up a word document in word (so it would have to open the application itself) and then be able to do everything that i can do using the word vb editor. is there some easy way to do this?

Opening An Application Such As Word Document Using Word
how to open a .doc file using a word exe through vb gui.

regards
raghav

Opening Word Document From Vb6
I am opening a Word document from my VB app - I have made it the active document but it doesnt always open on top of my app - it usually appears on my toolbar - how can I make it always open in the foreground?

Opening A Word Document
Hey I hope You u guys can help. i have a little bit of a problem.

i am wanting to open a word document from one of the forms in my project. at the minute i am using a simple hyperlink.

the problem i have is that when i come to making the project live on the network i will have to change all the hyper links.

the word document will be kept in the same folder as the project.

is there some code that will let me load this document.

thanx in advance!!

Opening A Word Document
Normally, to open say an excel document with my VB app, I would just have to give a command like:

Shell "C:Program FilesMicrosoft OfficeOFFICE11EXCEL.EXE " & File1.Path & "" & File1.FileName, vbNormalFocus

However, this does not seem to work with Word Documents, as it opens up Word but gives me an error. Does anyone know a good way to open a word document with the click of a button?

Opening A Word Document
Dear All,
I think this is a easy question for others, But Im facing difficulties to do this

I want to Open a saved word document within the OLE container in my VB application. Can i Do this by using OLE Container ?

Let me explain a little bit
I have a appliation which is sending Faxes through the Fax printer. Before sending it to a printer, User should able to edit/Ammend the document by opening it inside the Appliation (Within the OLE Container)

I know how to add Word in the Ole container. But How can i open a document by browsing it and how can i save that edited document through my VB application. I cud seen the all other menus in the contaner EXCEPTS FILE OPEN/SAVE

Pls help me to find this

Thanks

Opening A Word/ Pdf Document
I want to open a word.doc file (or a pdf file) as a help munual form the VB code. I have got this file as a object, with the get object command. But what is the command to open up this object. Load or Open commands give compile errors.

Opening A Word Document
Normally, to open say an excel document with my VB app, I would just have to give a command like:

Shell "C:Program FilesMicrosoft OfficeOFFICE11EXCEL.EXE " & File1.Path & "" & File1.FileName, vbNormalFocus

However, this does not seem to work with Word Documents, as it opens up Word but gives me an error. Does anyone know a good way to open a word document with the click of a button?

Opening A Word Document In VB
Hello everybody.

I have a very strange problem.

I'm trying to open a Word Document in VB.

This is the code I'm using:
-----------------
Dim WrdApp as Word.Application
dim WrdDoc as Word.Document

Set WrdApp=new Word.Application
Set WrdDoc=WrdApp.Documents.Open(FileName:=thefilenameiwanttoopen)
-------------------

I tried this code on a PC, and it worked just fine.
I tried it on another PC, but it's not working.It seems that Word is catching the File somewhere because if I try then to open it from outside VB, I get a message:
"This File is Locked For Editing...."

Please Help Me.

Thank you

Opening Word Document
i try to open an exisying word document but i can't and i get message error says
active x component can't create object
then i want solution for this problem

Opening Word Document
i want to click a command button for opening MS word Document
how to do it
thank for your answer

Opening A Word Document
I'm using right now the microsoft word 8.0 object library.
But I just wanted to know how to open a word document with this.
Because I don't want to use the shell function

Opening A Word Document
I need your help. I have 20 word docs that I need to access at any time. What is the code to run a word doc in vb?

Opening A Word Document
I have a little problem opening a word document on a LAN drive. The code I am using works fine if I am using one of my local drives but gives me this error when I switch to the LAN ("ActiveX component can't create object")

Here is the code:

'Documents.Open (SearchDirectory & "" & File)'

Searchdirectory is the path and file
is the filename to be opened.


Does anyone have any idea why this wont work on a lan? or what to do to fix it?

By the way....I am using NT

Any help would be greatly appreciated..

Thanks

Opening A Word Document
I have to type a form and I want it to be accesible through a VB program. Is there a way that i can get a word window or a Word document to open in VB

Opening A Word Document
i want to open a word document in a rich text box but that word document contains not just text but also pictures, anyone who knows how to do that. thanxs

Opening Word Document
Hi,

I'm not sure if this is the right section to post this. If it's not I apologize.
What I need is to know if it's possible to open a new word document with the name already set. I'm building a web application and I would like the user to select the file name for the new file, click a button and then word would open up with that file name already defined (so when the users saved the file it would save with that name and wouldn't ask for a file name).

Any help appreciated

Best Regards

Don

Opening Word Document From VB
Hi all,

I have a program that based upon a series of correct answers will open a word file from VB 6.0. Th problem I have is I want to make this an executable file where I can pull the file or files from the same folder with the vb program. In order to do this I would have to be able to use the program from other computers therefore I can't specific the path (c Any ideas on how to do this?

Thanks

PS. The program works fine with the path and filename.

Opening A Word Document In VB
Hello everybody.

I have a very strange problem.

I'm trying to open a Word Document in VB.

This is the code I'm using:
              -----------------
Dim WrdApp as Word.Application
dim WrdDoc as Word.Document

Set WrdApp=new Word.Application
Set WrdDoc=WrdApp.Documents.Open(FileName:=thefilenameiwanttoopen)
              -------------------

I tried this code on a PC, and it worked just fine.
I tried it on aonother PC, but it's not working.It seems that Word is catching the File somewhere because if I try then to open it from outside VB, I get a message:
"This File is Locked For Editing...."

Please Help Me.

Thank you

Opening Word Document From VB
Hello, I am curious and I am sure this is simple but seeing as how i cannot find my MSDN disk or anything I was curious if anyone knew how I can open a word .doc file from vb and just read it in very similar to a text file one line of text at a time into a var? any code snippets or anything to get me started, thanks.

-Shane

Opening A Word Document From Within Access
wondering what the best way to do this is ?

i have a client who receives Word document CVs via email.
They will then save the CV word document in one of several folders on their network.
They have an Access2003 database with lots of client names in.
They need to be able to link specific clients in the database with their CV that will be in a folder on the network. The best way to do this ?
They will want to click on a button(or something) in the database (which i wrote) and open up the CV in MS Word.

Any ideas on the best way to do this much appreciated.

Opening A Word Document From An FTP Site
Hi there everyone

I'm trying to open a word document from an FTP site.

If i go into word and onpen the document like so
ftp://User:Pass@Ftp.Site.com/Test.doc word loads the document

Try that from Vb and it does not work.

The next thing i tried was to record a macro and see if that would give me more info. Well it seams to strip out the username and password.

So add them in and the macro runs ok.
Exit word and re load it and run the macro and wow it doesn't work.

So my question is can word do it or not.
Will i have to copy the document to a tempory directory and then copy it back once saved.

If anyone can help i would be most grateful.

cheers
Andy

Opening A Word Document And Saving
Hey guys well im new here but id just like some advie on what would be the code to open up an existing word document and then do a save as so it will save it as a txt file, i need to do this so i can then import it into a table into microsoft access because the file which opens at the moment in word is an rtf file and access rejects it due to its format. anyhelp would be great thanks
rob

Opening Word Document Without Users Seeing It
I did search the message board and did find a thread similiar to this, although it did not work so I decided I would try posting this anyways.

My problem is that I am reading in some data from a Word File and updating an Excel file. My program works great, the only problem is that the word document pops up in front of the user for a split second. I woudl really like to get past that if I could. Here is my code:

Dim word As New word.Application

word.Visible = False
word.Documents.Open (strWordFile)

' reads in entire word file
strWord = word.ActiveDocument.Content.Text
word.Documents.Close
word.Quit

If anyone has any ideas, I would really appreciate them! Thanks,

Brian

Opening A Word Document From Access
Is there any code or anything that I can use to ope a word document from my access database?

Problem Opening A Word Document In VB6.0
I am writing a piece of code that will make a copy of a word document and then open it for the user to edit.

I create the directory.
I copy the file.

But when I try to open it I get an error 13 Type mismatch. This is driving me insane at such a late (early local 4am) time.

value of txtLink is "c:projects estlinkitdoesntwork.doc" (without the quotes)

I tested the oWordObject and it is a Word instance


VB Code:
On Error Resume NextSet oWordObject = GetObject(, "Word.Application")If err.Number = 429 Then    err.Clear    'no instance found, create new one    Set oWordObject = CreateObject("Word.Application")    bOpenedWord = TrueElseIf err.Number <> 0 Then    GoTo err_End IfOn Error GoTo err_oWordObject.Visible = False Set doc = oWordObject.Documents.Open(txtLink, , False, False, , , , , , , , False) '<------------- this is where it breaksdoc.Bookmarks("bkmkSubject").SelectoWordObject.Selection.text = Trim(txtPolicyTitle)doc.ActiveDocument.Bookmarks("bkmkIssueDate").SelectoWordObject.Selection.text = nz(txtIssueDate)doc.ActiveDocument.Bookmarks("bkmkPolicyNumber").SelectoWordObject.Selection.text = Trim(txtPolicyNumber)oWordObject.Visible = True


any ideas?

Thanks!

-Dima

Opening A Word Document And Saving It As A Htm. Please Help
Hi Guys,
I have around 1000 word documents. I need to put all of these documents on the web as .htm files. Does anyone have any code that will open up each of these documents in word and save them as .htm files???
This would be great if someone could help me with this.


Thanks in advance

Cheers
JK

Opening A Word Document In Excel
Hi,

I have to make a quick piece of visual basic code to open a word document by a command button inside excel.

is there any code to do this properly? I have tryed code which would work in a exe:


VB Code:
Dim wApp As Word.ApplicationDim wDoc As Word.Document   Set wApp = New Word.ApplicationSet wDoc = wApp.Documents.Open(App.Path & "
otification.doc")wApp.Application.Visible = False


How would I adapt that, or make new code, to make it work in excel?

Thanks, the App.Path of course won't be in Excel - unless u can do that?

Thnx

Problem With Opening Word Document
Is it possible to open Word Docoument with WebBrowser. I want to open the Word Document just for reading only and no editing is will be allowed...if so what it is the codes for that....

Thanks for your help

Opening An Existing Word Document
Hi

Im having trouble opening a saved word document from one of my VB programs. Id be very gratefull if anyone could give me a quick hand.

Thanks

VB(A) In Word Fails On Re-opening Document
Hi there,

I've been working on a project concerning VBA in Word 2003.
The idea is to have a document partially automated as follows:

Document "Doc A" is a document that contains a (one single) textbox. This textbox has the following code:

Code:


Private Sub TextBoxVolgNummer_Change()
' Update body fields
ActiveDocument.Variables("VolgNummer") = TextBoxVolgNummer.Value
ActiveDocument.Fields.Update
Application.ScreenUpdating = True
End Sub



The result of this is a field in "Doc A" being updated whenever a user enters whatever value in the textbox; The data is stored within the document as:

Code:

<w:DocumentVariables>
<w:VolgNummer>4562</w:VolgNummer>
</w:DocumentVariables>



So far so good.

Whenever a user finished filling in the document, he saves it in some location and it's ready for printing/archiving. The problem however comes up when the user wants to open the document:
The VB(A) just fails. The textbox CAN be filled (along with its restriction-properties (max 3 chars)) but it does not update the fields within the document.

For short:
When the user saves the document and tries to reenter a value in the textbox, it still works. After re-opening the document, it does not update the value.

We've tried multiple computers with all Office updates.
We've tried setting up the document completely several times without using old code.

Any help would be greatly appreciated!

cheers,
jeroen

Opening A Word Document In Access 97
I am creating a custom menu bar for my database. I need to add a Word document to my Help menu. The document is an extensive manual on the database. I was wondering if anyone knew how to write that code. I can open Word through the wizard:

Dim oApp As Object

Set oApp = CreateObject ("Word.Application")
oApp.Visible = True

But I can't figure out how I would open a particular document instead of a new document.

Any help would be greatly appreciated.
Crystal

Opening A Specific Word Document
Is it possible to open a specific Word document using VB having obtained a Filename using a CommonDialog box. I am attempting to conduct a search of coded word filenames, filtered on the search criteria, into a Common Dialog "Open" box. I can select one of the returned files and obtain the Filename, but cannot open the required file. I am using VB5, however I note that the method "OpenFile" is available in VB6. Will this open the required Word document ?

Update Field In Word Document That Does Not Have A Value
Hi All

I am entering values to my document using this command:
--> oDoc.Variables("name").Value = x <--

After I finish to fill some of the values I do this command:
--> oDoc.Fields.Update <--

The problem is that in variables that I did not entered any value I get instad of nothing the message:
--> "Error! No document variable supplied." <--

Does anyone have sujestions??
How can I make it happend so variables that does not get any value will stay empty.


Thanks A lot
Solo1

Need To Export SQL Data To XML File. 1 Field Is A BLOB (binary Field)
I'm a VB/SQL newb looking for some help on exporting records from the DB to an XML file. one of the challenges is that i have one field that is a Binary datatype (BOLB). i need to export that data out and convert it from its Binary state to readable text and save it to an XML file. Can some help me with this?


i will need to be able to specify how the XML file is laid so i can designate the tag names to be compatible with my web software.

Sample code, small projects...anything would be great.

Thanks
GK

Opening A New Word Document Based On Template
Hello,
A few years ago I had an Excel 97 spreadsheet that opened a new document (based on Word templates) depending on laboratory results for leukaemia cell markers.
These results where Positive or Negative for each test (there were a total of eleven), and depending on the pattern, a particular Word template would be selected and opened for modification and printing.
I have tried to convert the macro to VB6 as I would like to make it an executable.
The question is ... I can't seem to get the Word document to open - I have added Microsoft Office 11.0 Object Library.
Thankyou,
Nene.

Code:
Private Sub cmdCalculate_Click()
Dim objWord As Word.Application
Dim objDocument As Word.Document
Dim strMsg As String
Dim strStyle As String
Dim strTitle As String
Dim strResponse As String
Dim strMystring As String

If cbocd7.ListIndex = 1 And _
cbocd10.ListIndex = 1 And _
cbocd19.ListIndex = 1 And _
cbocd13.ListIndex = 2 And _
cbocd14.ListIndex = 1 And _
cbocd15.ListIndex = 1 And _
cbocd33.ListIndex = 2 And _
cbocd34.ListIndex >= 1 And _
cbocd117.ListIndex >= 1 And _
cbocd56.ListIndex = 1 And _
cbohladr.ListIndex = 2 Then
'open word template leukaemia1.dot
strMsg = "Thankyou for using Acute Leukaemia Panel Number 1." & Chr(13) & "Click on OK to proceed to panel."
strStyle = vbOKCancel + vbInformation + vbDefaultButton1
strTitle = "Acute Leukaemia Panels"
strResponse = MsgBox(strMsg, strStyle, strTitle)
If strResponse = vbOK Then
strMystring = "OK"
Set objWord = CreateObject("Word.Application")
Word.Application.Visible = True
Set objDocument = objWord.Documents.Add(Template:= _
"C:Program FilesMicrosoft OfficeTemplatesleukaemia1.dot")
', NewTemplate:=False, DocumentType:=0)
Else
' User chose Cancel.
strMystring = "Cancel"
End If

ElseIf cbocd7.ListIndex = 2 And _
cbocd10.ListIndex = 1 And _
cbocd19.ListIndex = 1 And _
cbocd13.ListIndex = 2 And _
cbocd14.ListIndex = 1 And _
cbocd15.ListIndex = 1 And _
cbocd33.ListIndex = 2 And _
cbocd34.ListIndex >= 1 And _
cbocd117.ListIndex >= 1 And _
cbocd56.ListIndex = 1 And _
cbohladr.ListIndex = 2 Then
'open word template leukaemia2.dot
strMsg = "Thankyou for using Acute Leukaemia Panel Number 2." & Chr(13) & "Click on OK to proceed to panel."
strStyle = vbOKCancel + vbInformation + vbDefaultButton1
strTitle = "Acute Leukaemia Panels"
strResponse = MsgBox(strMsg, strStyle, strTitle)
If strResponse = vbOK Then
strMystring = "OK"
Set objWord = CreateObject("Word.Application")
Word.Application.Visible = True
Set objDocument = objWord.Documents.Add(Template:= _
"C:Program FilesMicrosoft OfficeTemplatesleukaemia2.dot")
', NewTemplate:=False, DocumentType:=0)
Else
' User chose Cancel.
strMystring = "Cancel"
End If

ElseIf cbocd13.ListIndex = 2 And _
cbocd15.ListIndex = 1 And _
cbocd33.ListIndex = 2 And _
cbocd34.ListIndex >= 1 And _
cbocd117.ListIndex >= 1 And _
cbocd56.ListIndex = 1 And _
cbohladr.ListIndex >= 1 Then
'open word template leukaemia3.dot
strMsg = "Thankyou for using Acute Leukaemia Panel Number 3." & Chr(13) & "Click on OK to proceed to panel."
strStyle = vbOKCancel + vbInformation + vbDefaultButton1
strTitle = "Acute Leukaemia Panels"
strResponse = MsgBox(strMsg, strStyle, strTitle)
If strResponse = vbOK Then
strMystring = "OK"
Set objWord = CreateObject("Word.Application")
Word.Application.Visible = True
Set objDocument = objWord.Documents.Add(Template:= _
"C:Program FilesMicrosoft OfficeTemplatesleukaemia3.dot")
', NewTemplate:=False, DocumentType:=0)
Else
' User chose Cancel.
strMystring = "Cancel"
End If

ElseIf cbocd7.ListIndex = 2 And _
cbocd13.ListIndex = 2 And _
cbocd33.ListIndex = 2 And _
cbocd34.ListIndex >= 1 And _
cbocd117.ListIndex >= 1 And _
cbocd56.ListIndex = 1 And _
cbohladr.ListIndex >= 1 Then
'open word template leukaemia4.dot
strMsg = "Thankyou for using Acute Leukaemia Panel Number 4." & Chr(13) & "Click on OK to proceed to panel."
strStyle = vbOKCancel + vbInformation + vbDefaultButton1
strTitle = "Acute Leukaemia Panels"
strResponse = MsgBox(strMsg, strStyle, strTitle)
If strResponse = vbOK Then
strMystring = "OK"
Set objWord = CreateObject("Word.Application")
Word.Application.Visible = True
Set objDocument = objWord.Documents.Add(Template:= _
"C:Program FilesMicrosoft OfficeTemplatesleukaemia4.dot")
', NewTemplate:=False, DocumentType:=0)
Else
' User chose Cancel.
strMystring = "Cancel"
End If

ElseIf cbocd13.ListIndex >= 1 And _
cbocd14.ListIndex >= 1 And _
cbocd15.ListIndex >= 1 And _
cbocd33.ListIndex >= 1 And _
cbocd34.ListIndex >= 1 And _
cbocd117.ListIndex >= 1 And _
cbocd56.ListIndex = 1 And _
cbohladr.ListIndex >= 1 Then
'open word template leukaemia5.dot
strMsg = "Thankyou for using Acute Leukaemia Panel Number 5." & Chr(13) & "Click on OK to proceed to panel."
strStyle = vbOKCancel + vbInformation + vbDefaultButton1
strTitle = "Acute Leukaemia Panels"
strResponse = MsgBox(strMsg, strStyle, strTitle)
If strResponse = vbOK Then
strMystring = "OK"
Set objWord = CreateObject("Word.Application")
Word.Application.Visible = True
Set objDocument = objWord.Documents.Add(Template:= _
"C:Program FilesMicrosoft OfficeTemplatesleukaemia5.dot")
', NewTemplate:=False, DocumentType:=0)
Else
' User chose Cancel.
strMystring = "Cancel"
End If

ElseIf cbocd7.ListIndex = 1 And _
cbocd10.ListIndex = 1 And _
cbocd19.ListIndex = 1 And _
cbocd13.ListIndex = 1 And _
cbocd14.ListIndex = 1 And _
cbocd15.ListIndex = 1 And _
cbocd33.ListIndex = 1 And _
cbocd34.ListIndex >= 1 And _
cbocd117.ListIndex >= 1 And _
cbocd56.ListIndex = 2 And _
cbohladr.ListIndex = 2 Then
'open word template leukaemia6.dot
strMsg = "Thankyou for using Acute Leukaemia Panel Number 6." & Chr(13) & "Click on OK to proceed to panel."
strStyle = vbOKCancel + vbInformation + vbDefaultButton1
strTitle = "Acute Leukaemia Panels"
strResponse = MsgBox(strMsg, strStyle, strTitle)
If strResponse = vbOK Then
strMystring = "OK"
Set objWord = CreateObject("Word.Application")
Word.Application.Visible = True
Set objDocument = objWord.Documents.Add(Template:= _
"C:Program FilesMicrosoft OfficeTemplatesleukaemia6.dot")
', NewTemplate:=False, DocumentType:=0)
Else
' User chose Cancel.
strMystring = "Cancel"
End If

Else
'open dialog box that suggests no panels found and see supervisor
MsgBox "No common acute leukaemia panels found - please see supervisor.", 1, "Acute Leukaemia Panels"

End If
End Sub

How Change Word Template Without Opening Document
Hello, I have thousands of documents that contain the location of a the original template on a server that is now decommisioned. this is resulting in delays when opening the docs. is there any way to automate a template change without having to go into each document?

Thanks
Nick

Opening Visio Document Via Word 2000 VBA
In Word 2000 VBA:

How do I open a Visio document via Word 2000 VBA?

Peter Faulhaber

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

I Need Simple Clarification On Opening A Word Document
I want to do a simple task of opening up a Word document (ex. c: estprint.doc), go to a bookmark (ex. testmark) , insert some text ("John Smith"), print the document and close the document without saving the document

I would also like to get fancy and check if Word is already up and running and just open the testprint.doc in it so I don't have multiple copies of Word running, which would speed things up not having to fire it up each time.

I am a rookie and have tried to learn on my own, but now I am just confused and don't know the correct way of doing it. I would like to find out what is the best way and stick with it to be consistent.
I have looked at different places for examples, put they all seem different
I have listed some example below:

An example that has the word "New" in front of "Word.Application" and doesn't use a "set" statement and opens the file with an "Open Filename=" statement
Dim Docname As String
Dim Wrd As New Word.Application
Docname = "c: estprint.doc"
Wrd.Documents.Open Filename=Docname


Another example that has a "Dim" and a "Set" statement and makes the objWord visible (does it need to be visible?)
Dim objWord as Word.Application
on error GoTo ErrSection
set objWord = new Word.Application
objWord.Visible = true
ErrSection:
MsgBox Err.Description
MsgBox Str(Err.Number)

Another example that uses "Object" and "CreateObject" and "Quit" and "set to nothing" (what does this do?)
Dim xlApp as Object
set xlApp = CreateObject("word.application")
xlApp.Visible = true
' do something
xlApp.Quit
set xlApp = nothing

Another example that opens the file with "Open("???.doc")" statement
Dim oWordObj as Object
Dim oWordDoc as Object
'
set oWordObj = CreateObject("Word.Application")
set oWordDoc = oWordObj.Documents.Open("c: est.doc")


Any help on either an quick example or at least clarification on why some people are doing things differently would be GREATLY appreciated,

Thanks,
Trevor

Save Word Document Filename As Field
I think I have a fairly simple question about a word macro.
I am very new to all this but just wanted to know if I could have my macro save the document with the filename "Invoice for [month]" where [month] is the MMMM date field, so that every month it obviously saves as a different name. It would also be nice if I could specify the exact folder so it was something like C:FilesInvoicesInvoice for August.doc for example.

Thanks for the help

-Justin

Btw, I'm using word 2002 if that makes any difference.

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

Table Field Size In Access And Opening A VB Recordset
I have an Access database that has a script which will import a text file into one big Table that stores the entire text file line by line. There is also a module which is used to parse the table containing the text file and store necessary information into the main database tables.

My problem is that the new text file I must import has longer lines than the original. When I go into the Design View for the big import table, it's field size is set to 81. I have tried changing that value to 160 to accomodate the larger line size, but for some reason when I import the file, it reverts back to the 81 size and stores only about half of each line.

Is there some kind of property or value that I need to add to the code where it opens a recordset to store into that table? There are only a few lines of code that I can see which are used to dump all that info, I'm just not exactly sure how they work. Any help would be much appreciated!!

Prevent Word Document Opening Without Macro Support?
G'day,

Been trying to find a way to prevent a word document from opening if the user selects "disable macros".

Anyone know if this is possible, and how?

Been driving me nuts........

Opening Excel Document In Word Without The Popup Screen
Hi there,

First post here so I just want to say "hi !" to everyone..

Ok, here's my question now : I want to know how to open a XLS file IN Word(i don't want to start Excel from Word...) WITHOUT having that **** popup screen (if the image doesn't show, see attchment plz..).

Because my macro needs to take all the XLS files in one folder and save them in RTF and it's really annoying having to click on "OK" for every files..

Also a quick second question : How can I choose a folder so the macro will search in every subfolders of that folder ?

Thank you very much !

:Curious George>

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