-
Help!!!
Hi
I am a total VB novice and am just starting to learn how to use it and thought this might be a good place to start to get some help!
I need to create a button on an MS Access form that will launch Word, open a blank doc, copy some of the information into the new document for the selected Access Record and then save this document with a filename that's built up from certain fields in the database.
Does this make sense??? If so, does anyone know how to script it???
Thanks v much
-
To start, Use Shell command to launch Word
-
OK. That's launching Word. What next???
-
This is a very general question so a general solution might be:
If you really are a complete novice as you say then what you may be better off doing for the word bit of your project is using the Word macro recorder.
If you run through the process with the recorder on and then press ALT + F11 to get at the generated code.
You will then need to create a Word Object in your Access VBA code and pretty much paste in the recorded stuff
With objWord
'Your recorded code here
End With
You may well need to tweak the recorded code a bit but it should give you a good start!
If you inspect the Word Code you will see the bits that need customising and so populate these with the relevant variables.
I hope this has given you something to start with and you will find plenty of info at MSDN. eg
http://msdn.microsoft.com/library/de...ordObjects.asp
if you have any specific questions I am sure people in this forum will help you out!
-
Thanks!!
That looks like the best way to go about this. I'll let you know how I get on!