Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need code for opening an MS Word 2000 document 2

Status
Not open for further replies.

peitzza

Technical User
Apr 13, 2000
80
US
does anyone know the code for opening and printing a microsoft word document on a form in MS Access i would like to do i with a comand button. thanx in advance - peter <p>Peter Heaton<br><a href=mailto:heaton@characterlink.net>heaton@characterlink.net</a><br><a href= it how ever you want</a><br>
 
<b><br>Dim WordPath, DocPath As String<br>Dim Retval As Variant<br>WordPath = &quot;C:\Microsoft Office97\Office\Winword.exe&quot;<br>DocPath = &quot;X:\MyDoc.doc&quot;<br>Retval = Shell(WordPath & &quot; &quot; & DocPath, vbMaximizedFocus)<br></b><br><br>jsut change the WordPath and DocPath to fit your needs.<br><br>you may also want to check out DougP's FAQ on related topic.<br>just hit the FAQ tab at near the top of this page. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Yo Brain,<br>&nbsp;the heading said Word 2000<br>you pasted <br>C:\Microsoft Office97\ <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
sorry Doug, i was giving the generic path as an example, i don't have 2000 on that machine so i wasn't sure if the actual path word have been C:\Microsoft Office2000\ or what.<br><br>i try to add a disclaimer about changing actual path names, because they can always be different for everyone.<br> <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Hi Brian<br><br>Hope you can help?<br><br>I tried the solution you gave but ran into a problem with it. I now the code was for opening an MS Word 2000 document but thought i would try it for word 97.<br>The path to Winword works fine but I found that the path to the document has to be in the Dos format.See code below.<br><br>Dim WordPath, DocPath As String<br>Dim RetVal As Variant<br>WordPath = &quot;C:\Program Files\Microsoft Office\Office\Winword.exe&quot;<br>DocPath = &quot;C:\Mydocu~1\Dpoffi~1\iso\DP1-3-2.doc&quot;<br>RetVal = Shell(WordPath & &quot; &quot; & DocPath, vbMaximisedFocus)<br><br>Can you suggest a way to use the full path <br><br><br>thanx in advance<br><br>Mark Shone
 
There is no reason for the DOS path unless its on a 16 Bit operating System or the App is written using a 16 programing environment. Access was not, nor is '95 '98 NT4 or Win 2000<br><br>Are you using NT 3.51 or on a Novell 3.x?<br>I think that you mis-spelled the Path to the C: Doc but when you used the Blah~1 path you spelled it right.<br>I go to Explorer and pretend I am renaming a document or folder to copy its spelling to the windows clipboard and then paste it into Access.<br>So to copy Right click on a folder and click rename then press Ctrl-C then click off the folder cause you really are not renaming it. Don't close Explorer but go to Access and press ctrl-V to paste it then come back to Explorer and get the secondpart of the path, etc.<br><br>C:\My Documents\Your db Path\iso\DP1-3-2.doc&quot;<br><br>OK <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top