Re: How to open Word from Access

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thank you so much!
I believe this version suits me more since Word is not installed at my PC
but at the server from our office-network.
Will have time and the chance to test between Christmas and New Year.
Merry Christmas, Fio


"bob" <rgalway@xxxxxxxxxxxxx> schrieb im Newsbeitrag
news:uC9wwZIJHHA.3264@xxxxxxxxxxxxxxxxxxxxxxx
This is an alternative way, if opening specific documents, that does not
care what the path to the executable is:



Function OpenWordDocGen(strDocName As String)
Dim ObjApp As Object
'opens the doc
Set ObjApp = CreateObject("Word.application")
ObjApp.Visible = True
ObjApp.Documents.Open strDocName
End Function

Bob Galway




"Eric Blitzer" <EricBlitzer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DF5C8D55-24FC-4450-A243-6BCA845F743E@xxxxxxxxxxxxxxxx
Change your shell command to
Shell "C:\Programme\Microsoft Office\Office11\WINWORD.EXE"

Office 2003 is installed in the Office11 folder



"Fio Koller" wrote:

Hi there
Does anybody know how to open Word properly from Access?

Since we switched to Office 2003 this will not work anymore:

On Error Resume Next
AppActivate "Microsoft Word"
Set WordObj = GetObject(, "Word.Application")


Maybe I should take out most this following lines which may not be
needed
anymore:


If Err = 429 Then
If Application.IsCompiled = False Then 'Bei A-97, das NICHT MDE sein
darf:
Programm-Pfad
Shell "C:\Programme\Microsoft Office\Office\WINWORD.EXE", 3 'A97
vbMaximizedFocus) '=im Vollbild öffnen 19.05.01 Das ist es!!!
ElseIf Application.IsCompiled = True Then 'Bei A-XP: Programm-Pfad
Shell "C:\Programme\Microsoft Office\Office10\WINWORD.EXE", 3
'XP
vbMaximizedFocus) '=im Vollbild öffnen 19.05.01 Das ist es!!!
End If

If Application.IsCompiled = False Then 'Bbei A-97,
MsgBox "Diese Pause, weil Word für die folgenden Anweisungen zu
langsam öffnet. Bitte quittieren."
Else 'A-XP braucht die Pause nicht mehr (je nach Betriebssystem)
End If
AppActivate "Microsoft Word" ', -1 ', -1 'crosoft Word" ', 0 ', -1
'WordObj 'AnwID '"Microsoft Word" 'sichert, dass kein Code ausgeführt
wird,
bis "Word" vollständig geladen ist
End If
On Error GoTo 0 'damit wird die vorherige Anweisung "On Error Resume
Next"
ausser Kraft gesetzt
' Switches to Word when it is allready open
Set WordObj = GetObject(, "Word.Application") 'Verweis auf ein
Application
Objekt, auf die Kopie von Word, die gerade offen ist
With WordObj ' Do all following comands on behalf of object Wordobj
'.Visible = False ' Make word not visible
.Run MacroName:="KPF2"
'.Visible = True ' Make word visible
End With ' WordObj


Many thanks in advance
Regards, fio







.



Relevant Pages

  • Re: How to open Word from Access
    ... Dim ObjApp As Object ... 'opens the doc ... Else 'A-XP braucht die Pause nicht mehr ... With WordObj ' Do all following comands on behalf of object Wordobj ...
    (microsoft.public.access.macros)
  • RE: How to open Word from Access
    ... Change your shell command to ... Else 'A-XP braucht die Pause nicht mehr ... With WordObj ' Do all following comands on behalf of object Wordobj ...
    (microsoft.public.access.macros)
  • Re: REGEXP removing - il- - -b-f and - il- - - - f
    ... >> don't know what else to call opens behavior, ... >> die. ... > -e syntax OK ... operator without the need for parentheses: ...
    (perl.beginners)
  • How to open Word from Access
    ... Since we switched to Office 2003 this will not work anymore: ... Else 'A-XP braucht die Pause nicht mehr ... ' Switches to Word when it is allready open ... With WordObj ' Do all following comands on behalf of object Wordobj ...
    (microsoft.public.access.macros)
  • Re: opening a file
    ... Like other ironclad rules, this also has exceptions. ... The "check the return value" part was meant to be ironclad. ... The "what action to take part" (eg. die) was not meant to be ironclad. ... tangential to the script so you don't care whether the file opens but ...
    (comp.lang.perl.misc)