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

docmd not in word???

Status
Not open for further replies.

ElectronikBean

Programmer
Oct 10, 2002
24
GB
When I type docmd. - word vba does not produce a possible list of commands...

Does anybody know how to get word using docmd?

Could I be missing a reference?

Thanx.
 
I have some code that uses it...

I have the following references in the project:

Microsoft Word 8.0 Object library
Visual Basic for Applications
OLE Automation
Microsoft Forms 2.0 library
Microsoft Office 8.0 library
Microsoft Access 8.0 library

Not sure which one your missing but it's one of these.
 
DoCmd is NOT a part of the Word COM intrinsic commands. Each Office applications has support for their own objects. If you need to use DoCmd you would need to create an Access.Application using automation. Look at the Object tree for Access to determine the methods and properties.

Set oAcc = GetObject("Access.Application")
If Err.Number <> 0 Then
Set oAcc = CreateObject(&quot;Access.Application&quot;)
End If
oAcc.Visible = True
' Then open an Access file and use the data -------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top