![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Access textbox contents to Word via VBScript I have a form in Access 2003 with a few textboxes that are filled with user entered text and some from queries and a command button to execute the write to Word. I would like to write the contents of these textboxes to a Word (2003) document. Here is the code that I have thus far: Dim objWord As Object Set objWord = CreateObject("Word.Application") objWord.Visible = True 'only set to true so that I can see that something is happening objWord.Caption = "Tender Letter Writting Wizard" Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection 'not sure why this is here apart from finding it in a code snippet 'define the document text style objSelection.Font.Name = "Times New Roman" objSelection.Font.Size = "12" objWord.Activate objSelection.TypeText "this is user entered text" objSelection.TypeParagraph objSelection.TypeText "test message" objDoc.SaveAs ("d:\test.doc") 'objWord.Quit 'release object allocations as good practice Set objWord = Nothing Set objDoc = Nothing Set objSelection = Nothing I must say that I am pushing the llmits of my simplistic knowledge of Access. Any assistance would be greatly appreciated. Any links to similar examples and info site about how to do this would be appreciated also. Kind regards, Carl |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can vbscript capture Word.Application events ? | VB Script | |||
| [MS Word Macro] VBscript flag image to not print it | VB Script | |||
| Textbox scroll bar in access | .NET General | |||
| Vista won't find a file given a word in the contents | Vista file management | |||
| Access folder contents | Vista General | |||