Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.access.formscoding,microsoft.public.access.macros,microsoft.public.word.docmanagement,microsoft.public.word.programming
|
|||
|
|||
Opening Word Document Using Code
I have a puzzling issue relating to opening Word documents using code.
I have a control in an Access form that, when double-clicked, takes the string in the first field of that row, and opens a word document in a specified folder with the file name [string].doc. Ive noticed that the €œway€ the Word document opens is different, depending on whether I double-click the actual files in the folder, or use the control in my Access form. When I simply double-click the files in the folder, everything opens normally. On the other hand, when I use the Access control, there are weird menus, and the Word window is minimized. Im not sure I understand why. Ive pasted below the section of the code that Im using to open the Word documents. I need the Access control to open the Word documents exactly as they would open up if I just double-clicked those files from their folder. Any idea what Im doing wrong, or what I need to do to fix this? Thanks, Tom * * * * * * Private Sub File_DblClick(Cancel As Integer) Dim X As Double X = Shell("C:\Program Files\Microsoft Office\Office10\Winword.exe " & """P:\890\Rehearing\Comment Processing\Processing Folder\Filings for Processing\" & PartyName.Value & ".doc""") End Sub |
#2
Posted to microsoft.public.access.formscoding,microsoft.public.access.macros,microsoft.public.word.docmanagement,microsoft.public.word.programming
|
|||
|
|||
Opening Word Document Using Code
Use ShellExecute() API function to open Word according to local machine
file-association settings http://msdn2.microsoft.com/en-us/library/ms647732.aspx or Use GetObject() automation function to open a file http://www.csidata.com/custserv/onli...ocs/vbs117.htm -- Krgrds, Perry System: Vista/Office Ultimate VS2005/VSTO2005 SE "td" schreef in bericht ... I have a puzzling issue relating to opening Word documents using code. I have a control in an Access form that, when double-clicked, takes the string in the first field of that row, and opens a word document in a specified folder with the file name [string].doc. Ive noticed that the €œway€ the Word document opens is different, depending on whether I double-click the actual files in the folder, or use the control in my Access form. When I simply double-click the files in the folder, everything opens normally. On the other hand, when I use the Access control, there are weird menus, and the Word window is minimized. Im not sure I understand why. Ive pasted below the section of the code that Im using to open the Word documents. I need the Access control to open the Word documents exactly as they would open up if I just double-clicked those files from their folder. Any idea what Im doing wrong, or what I need to do to fix this? Thanks, Tom * * * * * * Private Sub File_DblClick(Cancel As Integer) Dim X As Double X = Shell("C:\Program Files\Microsoft Office\Office10\Winword.exe " & """P:\890\Rehearing\Comment Processing\Processing Folder\Filings for Processing\" & PartyName.Value & ".doc""") End Sub |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening Word Document Using Code | Microsoft Word Help | |||
Opening Word Document Using Code | Microsoft Word Help | |||
How to update ASK field code automatically when opening the doc? | Microsoft Word Help | |||
Opening a word merged document from Access code doesn't update | Mailmerge | |||
how do I fix documents opening in code? | Microsoft Word Help |