dbaisley
03-05-2001, 01:24 PM
I created a form in Access 97 and in the text box I would like to open that Word Document that is mentioned in my txtbox. Does anybody have the code that I need to launch the Document in Word. I've created the button to open word but it doesn't launch the document in the textbox. Please e-mail me at: dbaisley@usa.net
hi dbbaisley,
if you just want to open Word with your selected/entered doc in it then you can use
Dim strFilePath As String
strFilePath = "Full Path to File\FileName.doc" ' you should be able to get this from your text box(?).
Shell "C:\Program Files\Microsoft Office\Office\WINWORD.EXE " & strFilePath, vbMaximizedFocus
you may need to change the path to winword.exe depending on your setup
If instead you have a linked OLE that you want to update then
OLEUnbound5.SourceDoc = Full Path to File\FileName.doc" ' you should be able to get this from your text box(?).
OLEUnbound5.Action = acOLECreateLink
will change it to the new one,
HTH
Drew - apologies for the lack of mail but I'm at work and don't want to make it any easier to be caught http://www.access-programmers.co.uk/ubb/smile.gif
dbaisley
03-06-2001, 01:00 PM
Thanks for the info above but I would like this textbox to contain many different paths: Example c:\my Documents\next folder\ textdocument.doc
I want to insert a button that will launch this path to this word document.
I need a code that will launch Word, I have the button and it launches Word. Now I need it to launch my Document that is in my textbox on my form. Remember I have many different Docs. that are in ddirrent Forms in my paths.
Hi again,
if you modify the below code to read
strFilePath=me.YourTextBoxName
instead of
strFilePath = "Full Path to File\FileName.doc"
it will open the file listed in your text box in word.
I'm assuming here that you have the name and path of the file you want in this text box. If not - are you looking for a way to locate a file? Or do you have lots of entries in the one text box?
Drew
ElsVanMiert
03-07-2001, 12:06 AM
You might have to re-design your table. You should not store more than one path in one field.
Create one field per doc or, if you need an unlimited number of Word docs per record, then you need a subtable that holds the paths (1 field = 1 doc).
Maybe you should have a look at the "solutions"-page of the Word Wizard at www.unsoftwareag.com. (http://www.unsoftwareag.com.)