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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Type Mismatch" using a VBA TypeText

Status
Not open for further replies.

AlanKW

Technical User
Jun 20, 2002
161
US

I am using Access to create a word document. It is something that I have done in the past, but this has a twist.
Code:
Dim objWord As Object
Set objWord = New Word.Application
objWord.Documents.Add
objWord.Visible = True
With objWord.Selection
.....
.Font.Size = 12
.TypeText "Please find the enclosed Summary Report which details the aggregate score for each section of all records reviewed.  The final score of all of your records reviewed was " & Score
.Font.Bold = True
.TypeText (Score)
.Font.Bold = False

The first "Score" displays, but it sould be in Bold. The bold tag works because as soon as I start typing in the document where the cursor is, its in bold. I have tried
Code:
 .TypeText Score
and
Code:
.TypeText
Text=Score all with Run-Time error 13, TypeMismatch

thoughts?

 
And this ?
.TypeText CStr(Score)
Or this ?
.TypeText "" & Score

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 

Perhaps on a Tuesday or Wednesday morning, I woulda made that leap, but never on a Monday :)

Thank you very much.

Its interesting that this worked...
Code:
.Font.Bold = True
.TypeText ScoreFollowup
.Font.Bold = False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top