PDA

Click to See Complete Forum and Search --> : Active X OLE Microsoft Word Object Issue


Xman51
Mar 17th, 2005, 11:13 AM
Please help,

I have a form that has an OLE object which I am loading a Microsoft word File from a command dialog. The Problems are, (1) I would like a user to be able to save the word file, (2) it keeps refreshing in the window to the top of the document, and (3) there are no scroll bars for the file. Here is the code for my form:


Private Sub Form_Load()
Dim sFile As String

With dlgCommonDialog
.DialogTitle = "Open"
.CancelError = False
.Filter = "All Files (*.*)|*.*"
.ShowOpen
If Len(.FileName) = 0 Then
Me.Hide
Exit Sub
End If
sFile = .FileName
End With
OLE1.SourceDoc = sFile
OLE1.CreateEmbed sFile
Me.Caption = sFile
Me.Top = 0
Me.Left = 0

Form_Resize
End Sub


Private Sub Form_Resize()
On Error Resume Next
With OLE1
.Height = 10000
.Width = 10000
End With
End Sub
Thanks,

Xman

Xman51
Mar 18th, 2005, 09:27 AM
Did I mention the form is in VB6 (Not VBA)?!?!!? :sick: :confused: