Help for a beginner - creating rows,columns and formatting name

danboi10

Registered User.
Local time
Today, 05:57
Joined
Aug 15, 2012
Messages
19
Hi,

I am currently working on an automated letter and have in the most completed the automation. I have only two more issues to resolve and it can go live - I've searched the web and got no joy. :banghead:

It's a two parter! The first query relates to inserting a table and fields. I'd like my letter to automate a table; so 1 row and 5 columns, with the rows and columns adjusting to fit the information contained in each field. I've tried
Code:
WrdApp.Selection.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= 5
but no joy.

The second query is i'd like the automated letter to just return the first name from the ManagersName field (this field is the full name). I've managed to
Code:
WrdApp.Selection.TypeText Text:=StrConv([MANAGERS NAME], vbProperCase)
. To select the field and format the text but I just want the to return the first name. For reasons that baffle me the Managers Name Field must remain the full name!

Any help for a beginner would be appreciated.

Dan.
 
This is an Access forum so you may not get answers to specific Word questions.

You may have more luck by Googling
microsoft word vba sample code
http://bit.ly/ROgXpa
 
I probably should have mentioned that the automated letter is being generated using access 07 vba.

Sorry.
 
It doesn't matter that you are doing this from Access. When you automate Word, you are using WORD's object model, methods, and properties. Those will not be familiar to an Access VBA programmer. You will get an answer very quickly in a Word forum and you can translate it to work from Access. The differences are subtle but they exist. When I have to automate Word or Excel, etc from Access, I open the application, turn on the macro recorder and attempt to perform the steps I am trying to automate. I then take the generated VBA, clean it up and use it in my Access app.
 
Thanks Pat.

Will chase up after me return from leave.

Dan.
 

Users who are viewing this thread

Back
Top Bottom