Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.access.macros,microsoft.public.word.docmanagement,microsoft.public.word.programming
td td is offline
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.access.macros,microsoft.public.word.docmanagement,microsoft.public.word.programming
Perry[_2_] Perry[_2_] is offline
external usenet poster
 
Posts: 1
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening Word Document Using Code Daniel Microsoft Word Help 0 March 28th 07 01:53 AM
Opening Word Document Using Code Daniel Microsoft Word Help 0 March 28th 07 01:49 AM
How to update ASK field code automatically when opening the doc? Paola Microsoft Word Help 1 January 3rd 06 10:54 AM
Opening a word merged document from Access code doesn't update tjmax Mailmerge 0 September 13th 05 03:25 PM
how do I fix documents opening in code? franklewis3 Microsoft Word Help 1 January 15th 05 07:45 PM


All times are GMT +1. The time now is 08:13 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"