jason120au
Member
- Joined
- Nov 26, 2003
- Messages
- 42
- Gender
- Male
- HSC
- 2004
I have a Word Document which has been inserted into a form using an Active X control, how do I add scroll bars to the document?
Private Sub DoWordCount()
Dim objW As Object
Dim oDoc As Object
On Error GoTo Kill
Set objW = CreateObject("Word.Application")
objW.Visible = False
Set oDoc = objW.Documents.Add()
objW.Selection.TypeText (rtxMain.Text)
Dim Temp As Object
'dialog 228 being the word count dialog
Set Temp = objW.Dialogs(228)
Temp.Show
Set Temp = Nothing
objW.Visible = False
'Close Word
objW.DisplayAlerts = False
oDoc.Close False
Kill:
objW.Quit False
Set oDoc = Nothing
Set objW = Nothing
End Sub
Private Sub Command2_Click()
Dim RetVal
RetVal = Shell("C:\Program Files\Microsoft Office\Office10\WINWORD.EXE", 1) ' Run Calculator.
End Sub