S
Suzette
Hi there,
I am trying to utilize Word as an object in code so that I don't have to
have a reference to it. (Issues with me using Word 2003 and others using
2000).
Here is the code up to the point of error.
Dim wd As Object
Dim wdDoc As Object
Dim lngCount As Long
Dim sRange As Variant
Dim strFile As String
Dim strProvider As String
Dim sngRows As Single
'Set wd = New Word.Application
Set wd = CreateObject("Word.Application")
strFile = Dir(frmMain.txtFrom & "*.doc")
Do Until strFile = ""
lngCount = 0
wd.Visible = True
' wd.ScreenUpdating = False
' wd.WindowState = wd.WindowStateMinimize
wd.Documents.Open frmMain.txtFrom & strFile
frmMain.lblInfo = "Counting " & strFile & "...."
frmMain.lblInfo.Refresh
With wd.Selection
.HomeKey wd.wdstory
If I have the last line as above I get the error "Object doesn't support
this property or method"
If I change it to:
.HomeKey wdstory
The error is "variable not defined"
This will occur with all instances of methods for the selection. It reads
the homekey word fine but not the unit.
Any and all suggestions are welcome and appreciated. Even a suggestion as
to where to research for the answer would be great.
Thank you so much
Suzette
I am trying to utilize Word as an object in code so that I don't have to
have a reference to it. (Issues with me using Word 2003 and others using
2000).
Here is the code up to the point of error.
Dim wd As Object
Dim wdDoc As Object
Dim lngCount As Long
Dim sRange As Variant
Dim strFile As String
Dim strProvider As String
Dim sngRows As Single
'Set wd = New Word.Application
Set wd = CreateObject("Word.Application")
strFile = Dir(frmMain.txtFrom & "*.doc")
Do Until strFile = ""
lngCount = 0
wd.Visible = True
' wd.ScreenUpdating = False
' wd.WindowState = wd.WindowStateMinimize
wd.Documents.Open frmMain.txtFrom & strFile
frmMain.lblInfo = "Counting " & strFile & "...."
frmMain.lblInfo.Refresh
With wd.Selection
.HomeKey wd.wdstory
If I have the last line as above I get the error "Object doesn't support
this property or method"
If I change it to:
.HomeKey wdstory
The error is "variable not defined"
This will occur with all instances of methods for the selection. It reads
the homekey word fine but not the unit.
Any and all suggestions are welcome and appreciated. Even a suggestion as
to where to research for the answer would be great.
Thank you so much
Suzette