I have an application on access that export the data to word.
I did a query and the data export to word
my code is:
Dim db, rst
Dim strSQL As String
Set db = CurrentDb
'קישור ופתיחת וורד, והצגתו בצורה מוסרת
Dim objWord 'As Word.Application
'Set word as an application and make it invisible
Set objWord = CreateObject("Word.Application")
objWord.Visible = False 'True is visible
'שם המסמך
objWord.Documents.Add ("C:doc3.doc")
strSQL = Me.strSQL
Set rst = db.OpenRecordset(strSQL)
rst.MoveFirst
Dim strString As String
strString = ""
Do While Not rst.EOF
'ID---------------------------------
strString = strString & rst!nameID & vbTab & vbTab & "|"
'name-------------------------------
If Not IsNull(rst!fName) Then
strString = strString & rst!fName & vbTab & vbTab & "|"
End If
'lName---------------------------------
If Not IsNull(rst!lName) Then
strString = strString & rst!lName & vbTab & vbTab & "|"
End If
rst.MoveNext
strString = strString & vbCrLf
Loop
objWord.ActiveDocument.Bookmarks("aaa").Select
objWord.Selection.Text = strString
objWord.Visible = True
my question:
I want to export the data to a table in word.
I attach the file
(to work good put the file "doc3.doc" to "c:/")
how can I do it?
thanks :)
This is my First post - so please be kind. I'm quite new at coding things and have learnt almost every thing from this forum so far by search old posts but can't find the answer to the below. I know how frustrating it must be to answer the same question over and over again so if this has been answered before please accept my appologies and if you could direct me to the old post I'll pick it up from there.
I have managed to get my DB to output to Excel using the below code:
I have created this command button from tools that output the access report into word file. However, it prints all the record into word file, is there a way that it would print one record or selective record at a time. I mean, lets just say if I am on record 3 after I am done I press the button and I don't want it to output 1 to 3 record just the 3rd one. Is it possible to do it like that or not?
I have a question to ask you all. This has been killing :( me I have not been able to find an answer. :confused:
Lets say I have a form open. In this form, there are text boxes that have a persons name, address, an account number, and phone number. This part is the easy part.
Now, what I would like to do is some how when you click on the account number, (it doesn't have to be a link) it will open up another form that shows available Word Documents for only that account number.
Different account numbers will have different Word Documents available to them. When this new form opens, then the user can pick a Word Document that is available to them.
Is one better than the other to get information into Word Documents
Using access to control word and use mail merge (can I set up the data source for the word document from access...how?)
-or-
Using access, fill in bookmarks created in Word
I have about 30 word documents from a real estate company that they want data from the database merged into the word documents. Too much formating in the word documents to use access report. Any suggestions?
I have given up on doing this since I am obviously stupid, but I have a word document that has most things static and about 6 fields that are dynamic. I would like to develop a small GUI in access that the user can input the data into the fields and then click the print cmdbutton that I create and it will open the Word doc, fill the fields that need filled, then print the form.
I tried a mail merge, but I really need this to be a seamless process.
If I use a report in Access, will it hold Word formatting?
These are legal documents that are being printed out.
I wanted to do it with some type of web based app, but my web server is Windows and not Unix so I cannot use CGI.
How to match 4 character word or number or combination by identical 4 characters word or number or combination in one word have 10 or 15 characters.
I have to two separate tables (Table A and Table B). Table A has one column (Tag No) and Table B has about 15 columns with one column name Tag No as below
Table A
Table B
Tag No
Tag No
2009
ZZZ-2030-DC
2010
ZZZ-2010-M9P
[code]....
They're both in MS Access.I am trying to match 2 tables - columns (Tag No) with join query, but not success. I want to match 4 characters in Table-A with 4 similar characters in Table-B (Tag No) cell.What query is suitable to compare two tables.
The company are using Access 97 as the front-end to a SQL2000 database. Tables are updated, queries run and forms used. They are moving to SQL2005 but not considering updgrading Access 97. Will the current queries, forms etc still work? Thanks.
I have packaged my Access 2000 program using SageKey. When I open the installed runtime version of the database, and click on a menu button that performs a databse backup, there is no error, yet the file does not copy (note that I am using a function that utilises apiCopyFile). It does not do this in the full Access version where I have developed the program. Does anyone have any idea why it is doing this? And any suggestions to how I could fix this or change my approach?
I had copied my MS Access database that I made from work and tried to open it from my home to work. And it said it is only Read_Only. Why is that? Can I change this from my home PC or Can I work with this only from work?
Another thing, then I tried to create another database and I could only do this by creating table from design view and entering data. But I was not able to create it using the table wizard. When I click on the table wizard, nothing happens.
My work's MS Access is 2000 professional version I think, and my home MS Access is 2000l.
I'm new to this forum and it's my first post, any help is greatly appreciated.
I have just been given a big project of firstly transferring information we hold in word documents over to Ms Access and then using ASP or .NET I got to make this a searchable, more user friendly web page displaying the information from the database.
I have tried searching on the web but have not found anything that can transfer information from a table in a word document to a table in Ms Access, does anyone know of anything out there that allows this to be done without losing any data in the transfer?
I have tried saving the document as a text file and importing it into Access but it did not transfer the data across correctly.
Hi there, I am doing a project for my A level computing, and for my mum's financial advising.
I am to assume no knowledge of computing on her part, and so i cannot make it up to the end user to know how to mailmerge. I was wondering if you could help. I can have it in a query, form or table form, whichever is best for this, but i need to be able to make a button which exports a record into a MS word mailmerge. This is just to make a simple letterhead. I need a button that says " Write to client ", and once it is clicked it needs to open a letter addressed to them. This is my problem. I have noticed when the data is in a report, there is an export to MS Word button, which is very close to what i want as i could use that and get a good enough mailmerge, but is there a way to run this from a macro or using VB? I did VB last year for my computing project and so i understand a fair amount of it. I want to just make one word document, which will open as mailmerged with the clients data. Please help if you can, I am sure it is possible as i can see you can mailmerge from access, and there is even a button to do it.... kind of, i just need to be able to make my own. Thankyou so much for your help. Steve ( Microsoft Access 2003 )
I have an Access 2007 Database, containing Dues records for a Membership type application. Each Month I produce a Newsletter vis Publisher 2007, which ends up in PDF format. e-mail Address information is in Outlook 2007, snail mail adress info is in Access.
I want to be able to send an e-mail (Merge ??) to all those who have e-mail, with the Newsletter as an attachment, and with the Dues data in the body of individual e-mails (Merge ??). As the data resides in a number of applications, can someone point me in the direction I should take to achieve this.
I have a rather large form that I created in Access. It is mainly a travel reimbursement form. It has numerous drop down fields for travelers, dates, etc.
My problem is, how do I email it? I would like for the receiver to see the "printable version". When I try and export it currently, I don't have the ability to send it that way. I can send it as an Excel document, but when I view it, it is about 10 pages wide.
Is there any easy way to make the screen view visible to the receiver?
Any help would be appreciated as my company is opening a satellite office and our administrative assistants will need to get these forms.
I have a word doc which i can open from Access but i need advice on something i would like to try out.
I have a form with a patients name and i can scroll through the table through here(on the form using nav buttons) as well and see other patients information. What i'm trying to do is according to whoever is on the form when they click on the button to open the word doc i want the patients name to appear on the word doc.
I guess it's like a Mail merge but i want the data to be pulled from the form like the patients name and address and i want this information to go onto the Word Doc. Any ideas on how to do this.
I use code like the following to build a Word doc from data from multiple linked tables:
Public Sub Build_Word_Doc()
Dim wrdApp As Word.Application Dim wrdDoc As Word.Document
Set wrdApp = New Word.Application Set wrdDoc = New Word.Document wrdDoc.Activate wrdDoc.Select .... {code to build and save doc}
End Sub
If the user does NOT have an instance of Word open when the code runs, everything processes as desired. If, however, they had Word open when this code executes, they receive an error and there is a "phantom" WINWORD.EXE left in Task Manager.
Is there a good way to check for the presence of an active Word doc before running this code, or any other suggestions to avoid the situation I described?
Any help would be appreciated, 'cause my users look at me cross-eyed when I tell them they have to close all Word docs before using my application.
I am currently printing a letter from access to word using a command button. So far, so good.
However, I wish to add the person's name on the letter who I am currently viewing on the form. The name of the fields on the form is called "FULL NAME".
Here is the code I am using to print the letter from Access:
Private Sub PrintLetter_Click() On Error GoTo Err_PrintLetter_Click Dim oApp As Object Set oApp = CreateObject("Word.Application") oApp.Visible = True Set appWord = New Word.Application ' The path/name of the Word document goes here Set wdDoc = appWord.Documents.Open("C:documents and settingsuserdesktopEXPRESS DIPLOMA LETTER.doc") wdDoc.PrintOut (False) wdDoc.Close (False) appWord.Quit Set wdDoc = Nothing Set appWord = Nothing Exit_PrintLetter_Click: Exit Sub Err_PrintLetter_Click: MsgBox Err.Description Resume Exit_PrintLetter_Click
Hi folks, can anyone assist me with my dillema, I am trying to merge records selected by the user from my Access database to word. Does anyone know of any VB code that I could use? Steve
i have a word doc that is built by code. at the end, after the doc is completely built, i save the doc and kill my word object. what i want to do is be able to launch the doc automatically for the user, but still be able to kill the code object used to create the doc. what i currently have, which obviously doesn't open the doc, is as follows: Code:wrd.ActiveDocument.SaveAs sOutputDir & sHeader & ".doc"wrd.ActiveDocument.Closewrd.QuitSet wrd = Nothing i can't figure out how to get word to open with my doc. i'm sure i'm overlooking something simple, but does anyone have ideas for me on this?
Can anyone help me with the following code? If I reboot my machine, open the Db and run the wordmerge, A WORD msg pop up with "Do you want to save the changes to letters1?" with a Y/N, cancel option. If I chose yes and then cancel, the word document will open and the code runs ok but, I am not sure that this is good practice as it leads to confussion. I am also trying to eliminate the msg that explains to user that they are about to merge from access to word. I think it will just confuse the user even more. However, If there is no work around, then I will have to live with that. The post has been up for a while but I have had no reponse todate. Very greatful for any assistance, Cheers, Steve
Private Sub cboReport_Change() On Error GoTo Err_Handler If Nz(Len(Me.cboReport), 0) = 0 Then MsgBox "You must select a correspondance letter" Else Dim WordObj As Word.Document Dim strPathtoYourDocument strPathtoYourDocument = "D:DataFrm_" & Me.cboReport & ".doc" DoCmd.SetWarnings False DoCmd.OpenQuery "qryMailMerge" DoCmd.SetWarnings True Set WordObj = GetObject(strPathtoYourDocument) WordObj.MailMerge.Destination = wdSendToNewDocument WordObj.MailMerge.Execute WordObj.Close wdDoNotSaveChanges WordObj.Application.Quit Set WordObj = Nothing Exit Sub Err_Handler: Beep MsgBox "You have cancelled this operation."
I have an Access spreadsheet that I can't get to merge with a word document. It freezes up every time I try and the only message I get is overflow. Does anyone know how to fix this problem?
The access form froze and they could do other things but Access remained frozen. They logged off and when they went back in Access opened but none of the form buttons or links were working.
The database is not split because it is used only by one station at a time.
Has this happened to anyone and does anyone know the cause?
Five people were trying to fix it when I walked into work (5 people who no nothing about Access other than using that one database) and I couldn't get a straight answer.
There are posts elsewhere on this forum about the adjustments you can make to Access to improve its performance on a wireless network, i.e. make sure you have XP SP2 and not an earlier version of XP, but the fact is that no programme will perform well on a network if the network isn't performing well. Here are a few things I've learned (the hard way!)
- Use USB wireless adapters, not card type adapters. One of the prime rules of wireless networking is to keep your adapter - and your Router - away from electrical equipment and metal objects, so why anyone even makes card adapters is beyond me.
- Place your adapters/Router as high as possible (above head height is best) using a USB extension lead for the adapters if necessary. Do not put them on or near metal filing cabinets!
- Think about line of sight when placing your equipment. If your Router and an adaptor are just on either side of a wall , opposite each other, the signal may only have to pass through, say, 6 inches of wall. If they are at opposite ends of their respective rooms, however, it may have to pass through several feet of the same wall!
-If there are other wireless systems nearby using the same channel as yours, change yours to a different channel even if the other signal is weaker than yours. Remember that you need to be 5 channels away from anyone else before there is 0% overlap in the frequencies. If you cannot achieve this because there are too many nearby networks, any difference is better than none.
I have a 9 user (each in a separate room) p2p network in my office running a split Access 2000 db. The place looks a bit odd with USB adapters stuck high up on the walls but it works. Only one user has the occasional hanging problem (about once a week) but she's using an oldish laptop with only 256k of RAM and it has to run Norton Internet Security at the same time. Three of the users have the db open more or less constantly, the rest have no problem or speed issues getting in whenever they wish.
Nearly forgot, our Wireless system is standard 802.11g. max distance from an adapter to the router is about 80 feet.
Sorry if any of the above is stating the obvious, thought it might help.
Having grown weary of the speed related issues and numerous bugs - I have decided to Uninstall 2007 / reinstall 2003. Now, howver I find that the uninstall fails and then rollsback.... what a pain in the a!
JPG attached shows the dialog that results when I try to remove. Does anyone have any ideas why this is happening - the folder in question does exist and I am System Administrator with full privelegs for write access etc. on the machine!
Why does this (poor excuse for an improvement) software persist in plagueing my life...!
I really would rather not have to reformat the drive to remove all traces of Office 2007.
I use below simple command line to start a macro in my Access database. Usually all works well. I start my bat file, command is executed and macro does its job.
However it always fails if I have a session of Access already opened even if it is a completely different database. If I use below then it opens another sessions of Access but does not execute the macro. I need to go into the second session and run macro manually. It works fine then.