Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

Maximising Word Window from Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BarryM - 30 Mar 2005 14:53 GMT
In Access 97 I want to open some Word documents at the same time without
creating more than one instance of Word.

The following code works but I have been unable to maximise the Word window
(not the document window) using code in access. Any suggestions?

Many thanks in anticipation.

Public Sub GetGuidesDoc(strDoc As String)
On Error GoTo ErrDocs
Dim MyWord As Object

'Open Word
Set MyWord = GetObject(, "Word.Application")   'error if Word not running
OpenDoc:
'Open the selected document
MyWord.Documents.Open strDoc
MyWord.Application.Visible = True

Exit Sub
ErrDocs:
Select Case Err
   Case 429   'ActiveX component can't create object
       'Word not running, open it
       Set MyWord = GetObject("", "Word.Application")
       GoTo OpenDoc
   Case Else
       MsgBox "Error " & Err & ": " & Error, 0 + 64, "Opening Word Docs"
End Select
End Sub
Gerald Stanley - 30 Mar 2005 17:01 GMT
Try
MyWord.Application.WindowState = wdWindowStateMaximize
after
MyWord.Application.Visible = True

I noted that you dim'd MyWord as an object.  Had you dim'd it as
Word.Application, then intellisense would help you.

Hope This Helps
Gerald Stanley MCSD

> In Access 97 I want to open some Word documents at the same time without
> creating more than one instance of Word.
[quoted text clipped - 26 lines]
> End Select
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.