Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

application not working

Status
Not open for further replies.

parkfairfax

Programmer
May 22, 2001
63
US
When I run the following code I get an error '91' " Object Variable or with block variable not set". Can anyone please give me a clue as to what I'm missing here. Thanks, GM

Private Sub Command12_Click()

Set appword = CreateObject("Word.Application") '

appword.Visible = True
strdoc = "a:\" & a ' where a is a variable
appword.Documents.Open (strdoc)


ActiveDocument.Select

With Selection.Find

.....(some text) {this is a routine that works, just get past the selection.find statement is the problem for me}

End Sub
 
You can probably skip the ActiveDocument.Select statement since you are not specifying anything to select. If you are trying to select the entire contents (Ctrl-A), just use the Selection.WholeStory call.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top