jbotts
asked on
VBA in Access 2007 unable to open Word 2007
Dim dirf As String
Dim rng As Range
dirf = MFunctions.ReadFile("CC_Fi leDir.txt" )
mpath = "C:\" & dirf & "\Reports\Patient-Summary- for-Bob-Sm ith"
Set wo = CreateObject("Word.Applica tion")
'Add a new document
wo.Documents.Add
'To speed the document creation
wo.ScreenUpdating = False
Set rng = wo.Application.ActiveDocum ent.Range
wo.WindowState = wdWindowStateMaximize
'Create the Title
With rng
.Paragraphs.Last.Range.Sty le = wdStyleHeading2
.Text = "Hello World"
End With
wo.WindowState = wdWindowStateMaximize
wo.ActiveDocument.SaveAs FileName:=mpath
wo.Visible = True
Dim rng As Range
dirf = MFunctions.ReadFile("CC_Fi
mpath = "C:\" & dirf & "\Reports\Patient-Summary-
Set wo = CreateObject("Word.Applica
'Add a new document
wo.Documents.Add
'To speed the document creation
wo.ScreenUpdating = False
Set rng = wo.Application.ActiveDocum
wo.WindowState = wdWindowStateMaximize
'Create the Title
With rng
.Paragraphs.Last.Range.Sty
.Text = "Hello World"
End With
wo.WindowState = wdWindowStateMaximize
wo.ActiveDocument.SaveAs FileName:=mpath
wo.Visible = True
It might help if you make the application visible immediately after creating it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did not select my own solution as the best solution.
ASKER