Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To open the word application and then a specific document I use late
binding and the following code (you need to replace "H:\DriveName\FolderName\MyDocument.Doc" with your own document and pathway): Dim WordApplication As Object Sub OpenFileNote() Call OpenWord With WordApplication .WindowState = 1 .Visible = True .documents.Open Filename:="H:\DriveName\FolderName\MyDocument.Doc" End With End Sub Private Function OpenWord() Dim strApp As String strApp = "Word.Application" 'check to see if Word is running On Error Resume Next If Not IsRunning(strApp) Then Set WordApplication = CreateObject(strApp) Else Set WordApplication = GetObject(, strApp) End If On Error GoTo 0 strApp = "" End Function Public Function IsRunning(ByVal myAppl As String) As Boolean Dim applRef As Object On Error Resume Next Set applRef = GetObject(, myAppl) If Err.Number = 429 Then IsRunning = False Else IsRunning = True End If Set applRef = Nothing End Function (EARLY BINDING IS THE OTHER APPROACH) HOPE THIS HELPS JASON "JRB" wrote in message ... I omitted to mention that the procedures have to be compatible with Excel 97 "JRB" wrote in message ... Is it possible to open Word with a specific document from an excel procedure I have managed to open word using: Application.ActivateMicrosoftApp xlMicrosoftWord but can find no way to specify the document to load I would like to run a mail merge, using Word, to create some mailing labels, print them and then return to Excel and closing the Word program Any (and all) suggestions greatly appreciated TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening word document through excel vba | Excel Discussion (Misc queries) | |||
Opening Word Document with excel | Excel Discussion (Misc queries) | |||
getting specific info from a word document into excel | Excel Discussion (Misc queries) | |||
opening a word document from excel | Excel Programming | |||
Opening a Word Document in Excel | Excel Programming |