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

controling Word2003 in Acc 2003 1

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I am creating a lengthy Word document and I go into word record a macro of what I need then copy and paste it into Access.
While in Word VBA editor I can write the code as well.
I type in something then hit the .dot and a list of items comes up, such as selection.cells.merge .
Can I do this in Access by adding a reference?
I added "Microsoft Word 11.0 Object Library but nothing shows when I press the .dot

TIA
this would speed my coding considerably

DougP, MCP, A+
[r2d2] I Built my own R2D2
I love this site and all you folks that helped me over the years!
 
Here is what I have for code
Code:
   Set objWord = CreateObject("Word.Application")
   
   'Word Object is created - now let's fill it with data.
   With objWord
   
       .Visible = True
       '.Documents.Open (strDocPath)
       .Documents.Open ("c:\PNG.dot")
...
I added this but it still does nothing
Dim objWord As Word.Document


DougP, MCP, A+
[r2d2] I Built my own R2D2
I love this site and all you folks that helped me over the years!
 
Dim objWord As Word.[!]Application[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
If you want to access methods of the application, you need:

Dim objWord As Word.Application
 
Still does nothing
I press .Dot and nothing happens
if I do other things like rs1.
then I see the ADO dot prompt list come up just fine
but it does not recognize the Word stuff

DougP, MCP, A+
[r2d2] I Built my own R2D2
I love this site and all you folks that helped me over the years!
 
have a star Remou
I had "Dim objWord as Object" up higher in my code
when I did debug compile it said duplicate
so I removed this Dim objWord as Object
and replaced it with this
Dim objWord As Word.Application

Works Fantastic


DougP, MCP, A+
[r2d2] I Built my own R2D2
I love this site and all you folks that helped me over the years!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top