I am just contimplating the best way to add word files into my database. I know you can add them as objects, however when they appear on the form they seem a bit 'messy'.
Does anyone have anytips how to make this look more professional, perhaps the use of links, or buttons?
Just looking for some more advice I am creating an application that contains employee details in access. I have the majority of the database working but I am stuck on a couple of thins, Firstly I would like to add the option to be able to add an employees CV to the databse and an option to open this. I found a good example that I thought would help me and it did in post 11 of the thread below but I cannot get the files to open in MS word so they can be viewed. The majority of the files to be opened will be ms word format. I just get the error object doesnt support this property or method
I am attempting to create a database where I can input a number that will display a word document, and pdf's, and be able to toggle through them. I have all the data compiled. I just need to present it in some type of a front.
I'm trying to add the information from a form and subforms to a report. This would be a medication mar sheet and needs to be in the format of the attached word document. I'm happy to do it in a report and change the formatting if that will work better. The personal info needs to go at the top and the medication needs to be listed on each sheet.
The form is called FrmMarSheet. It basically needs the info from that like the "sample mar sheet.doc". I can only get one medication per page to work at the moment.
I understand how to pass text boxes to bookmarked locations in Word, but when it comes to combo boxes, list boxes, or option buttons, I am lost. So, my problem this time is the following:
I have an access user form that is asking the user to input data and make selections. Once entered I am trying to get everything to export directly to respective bookmarked locations in a Word Report. I have my text boxes working and I have the combo box now working. The issue I am experiencing is with the user making multiple selections from a list box and I am not really sure how to get that to export to the word document.
Here is what I have:
Code: Dim strNames As String Dim ctl As Control Dim varItem as Variant 'ensure the user has made a selection from the testers name text box If Me.testersNamesText.ItemsSelected.Count = 0 Then MsgBox "You must select at least 1 Capability Testers Name"
[Code] ....
I am very new to trying to code with the Visual Basic side of things, I know this is probably the best method to do this but the issue that I am experiencing is receiving a Null error for the line with
And when I attempt to pass the strNames in place of the testersNamesText I receive that the user form can't find the field "strNames" referred to in my expression.
I'm using the below to merge from acces to word and create a new doc. All is well.However I need to save the output file type as PDF.When I try to change the docx to PDF, it corrupts?
Dim wordApp1 As Word.Application Dim docPath1 As String Dim fileName1 As String docPath1 = Application.CurrentProject.Path & "Merges" fileName1 = docPath1 & "CreatedCover Letter.docx" Set wordApp1 = New Word.Application With wordApp1
I have below vba code in a sub that opens word application and generates the data from a table based on criteria provided thru a form.
These lines are smoothly working..
But I need to place some headings in first line or second line of the document and then to start the table information to appear in the doc.
I tried to place my company name below way (see bold lines);
Dim db As DAO.Database Dim rs As DAO.Recordset Dim I As Integer
Set db = CurrentDb() Set rs = db.OpenRecordset("SELECT * FROM T_CustomerMaster WHERE SALESMANCODE='" & Forms!F_ReportMaster!TxtRepCode & "' order by custcode;")
WordSetup
doc.Tables.Add Range:=doc.Range, numrows:=1, numcolumns:=5 'Trying to place main heading 'doc.Range(1, 0).Text = "fsdafds"
[Code] ....
But the table starting from column 1 and cell 1 till data ends up.
Finally I converted my trial lines to remark as it is not working at all.
I am using the follow code to import data from a Word form into my MS Access 2010 DB:
Code: Set dbs = CurrentDb Set rst = dbs.OpenRecordset("tmpSIRs", dbOpenDynaset) With rst .AddNew
[code]...
On the Word Form, these two fields are drop-downs with three options: blank, No, and Yes. If the users leaves them blank, then Access ignores them--which is what I want. However, if the user says yes or no, Access puts a "-1" in the database. Both the Word form and Access field are text.
Code for displaying the Word Print dialogue box instead of sending it straight to the printer.
I have the following code:
'Open Word Set objWord = New Word.Application 'Letter document would be open Set objletter = objWord.Documents.Open(strletterpath & strworddoc) objletter.MailMerge.OpenDataSource (strletterpath & strletterfile) objletter.MailMerge.Destination = wdSendToPrinter 'normally print Dialogs(wdDialogFilePrint).Show objletter.MailMerge.Execute 'not normally here 'objWord.Visible = True
This is to produce a mailmerge based upon a query.
Previously on Access 2000 and Word 2000 it would display the print dialogue box, but I am trying to upgrade it all to 2013 and this does not do it now with Access 2013 and Word 2013.
I have just started to develop a database that will export data directly into a word template. I have used Word automation quite a lot but I'm new to trying to automate Word from Access.
It's going OK at the moment, I have got the db to open up the template, write data and then close. My objective is to add the data to multiple tables within word. So I have created several tables in my word template and then tried to select these tables and write to the them. Everything is thing for the first table but for any other table I get an error message saying that the member of the collection doesn't exit i.e. the table isn't there. I select the table using:
Code: objWord.selection.tables (2).select
I then used:
Code: objWord.selection.tables.count
To show how many tables were in the document and it doesn't matter how many there are, it always says there is 1 table.
why it can only see 1 table and what I can do to get around it?
a) Open a word document from MS access / VBA, b) Connect to data from a query c) mailmerge it d) Save it as a new document containing mailemerged letters.
The code does open the required document as I can see it open.
I put a message box to recheck that filename/path is what I mean, and to to know till which line the code runs. Code runs till that point and that word doc is seen open. I get the error message before
Then I get error message.
I was fooling around and was getting message " This command is not available because no document is open" I tried to remove few lines thinking redundancy. Before getting the message, I was also getting the error trapping message "No documents opened."
Now I am getting different message.
I am getting message " The remote Server Machine does not Exist or is unavailable"
Following is the code I have written.
Dim xlApp As Object Set xlApp = CreateObject("word.Application")
We need to replicate an Access report we have in Microsoft Word. The report has a fixed, small image in the header and so we embedded it in the report (it is not in an external file). To put this image in the Word document the only way we have come up with is shown in the code below.
Code: Dim apWord As Word.Application Dim doc As Word.Document Set apWord = CreateObject("Word.application") doc.Shapes.AddPicture "G:ImagesSinful Banner.bmp", False, True, 0, 0, 540, 42
Which requires an external image file. We really would like to avoid this. We could make a template Word document, but that too would be an external file. We know how to put this image in a table as an OLE object, but can't find any way to get it from the table into the Word document.
I have programmed a letter using automation to Word VBA. The letter works like a mail merge so it might cycle thru several records when it runs. I've separated each letter in the document with a section break. I'm having a problem with the header. I've successfully added a header, but when it moves to the next record, it replaces the header in the entire document with the current record. I want each section to insert data from that record. How can I fix this? Below is a sample of my code (note: the linktoprevious doesn't seem to work either).
x = 1 'Create Header With ActiveDocument.Sections(x) .Headers(wdHeaderFooterPrimary).LinkToPrevious = False .PageSetup.DifferentFirstPageHeaderFooter = True
Not sure if this is possible but I am trying to extract data from a word document to set up a database.
Basically I am trying to capture data from completed forms, similar to the sample attached, the actual blank form is 20 pages long and once completed can be as many as 30 pages, or even more, although the format doesnt change (i.e. individidual cells will expand to fit the data in the cell).
I want to be able to scan through the completed forms and extract the data i.e. Full Study Title, Short Study Title, Study Type etc. into a database.
The issues: 1. Each document will have a different name but will be stored in the same location. 2. What is on page 8, for example, in one document is not necessarity going to be the same on every document (due to expanding cells) 3. Each sector is in a separate table but tables can spread across several pages. 4. Some data is stored in a checkbox format rather than text. 5. I dont want to extract all of the data, only certain sections (at least at this stage).
I'm using the below to merge an access form into a word template (it's a starter for 10).
That works fine. What I need to do is save the word template as HTML so I can then upload it to my website.
Dim wordApp1 As Word.Application Dim docPath1 As String Dim fileName1 As String Dim PageName As String PageName = Forms!Frm_Page_Create![Page] docPath1 = Application.CurrentProject.Path & "Merges"
If I use the word template named "ABC.dot" as attached and write the following piece of code to print off the letters with different appropriate background , it works perfectly fine:
Code: Sub PrintLetters() Application.DisplayAlerts = False Dim cn As ADODB.Connection Dim rs As ADODB.Recordset Dim r As Long Set cn = New ADODB.Connection
[Code] ....
But if I combine two templates together in one template as attached "Capita.dot" then it doesn't display background picture at all in any of the cases. I am using the same piece of code but the background image is not displaying. The background image shows logos for each letter like For capita letters , the logo will be capita . For Friends Life letters the logo background will be different.
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.
I have a database of film events, for which i have to do posters.
With the click of a button on a form, access opens word and puts all the fields in, including a field called [photo], which is the name of the image stored outside of the database.
Is there a way of getting that image into the word Document with all the other fields? Or have I just wasted an afternoon....
I'm using ACCESS 2010. I have a form which is having a embedded word document. What I'm trying to do is i want to enable user to format a mail in the embedded word document which will contain rich text and screenshots then with a click of button an outlook mail should open and content of this document should be pasted there. Once user sends this email, I want to save content of embedded document in the database.
I'm doing a project for my work. I created a few reports in Access. Some of these reports are simple graphic bars. How can I insert these reports into a word document template?