In the menu in word there is some option to view the documents
1. Normal
2. Print Layout
3….
I open the word’s document from the access
I insert value from the access into word.
I asked here some question in last week and I helped so much.
My question now is:
In the document in the word I put some bookmarks.
One of the bookmarks is on the header (Title of the document)
And then when I open the document its open in a “Normal” view
I want to open the document in “Print Layout”
Can I open a document in “Print Layout” by code?
The problem code is:
objWord.ActiveDocument.Bookmarks("nivchan").Select
objWord.Selection.Text = Me.M_NIVHAN
Because the Bookmark: “nivchan” is on the header.
I have created a report with a subreport for my database. The user selects the project for which he/she wants to see a report. Once the project is selected, the report is displayed in a popup window and maximized in the print preview layout. This allows the user to view and read the report. Once this is done, there are no buttons or menus on the screen that allows the user to send the report to a printer or file.
Other than the report, there are minimize / maximize and close buttons at the top right of the window and page selection buttons at the bottom left of the window. If the user wants to print the report, they must either hit ctrl-P or right click the mouse on the screen to display a menu from which the user can select print to open a print dialog box. Is there any way to add a button or menu to the print preview that appears on the screen to make printing easier?
I have the below code behind a button to merge and print into MSWord and it's working wonderfully. However, how can I modify it to print 1 copy of page one, TWO copies of page 2 and one copy of page 3?
_________________________________________ Private Sub Print_Reconsideration_Click() Dim objWord As Word.Application 'Start Microsoft Word 2000. Set objWord = CreateObject("Word.Application")
With objWord 'Make the application visible. .Visible = False
'Open the document. .Documents.Open ("G:PharmacyPrior Auth Docs and DataRevised Pharmacy Denial Processes econsideration.doc")
'Move to each bookmark and insert text from the form. .ActiveDocument.Bookmarks("bmkFirstName").Select .Selection.Text = (CStr(Forms!frmDenial!MBRFirst))
.ActiveDocument.Bookmarks("bmkMDZip").Select .Selection.Text = (CStr(Forms!frmDenial!MDZip)) End With
Print_Reconsideration_Err: 'If a field on the form is empty, remove the bookmark text, and 'continue. If Err.Number = 94 Then objWord.Selection.Text = "" Resume Next
End If objWord.Application.Options.PrintBackground = False objWord.Application.ActiveDocument.PrintOut ActiveDocument.Close wdDoNotSaveChanges End Sub
Hi I want to open a Word Document in access, so I am using the Runapp macro. It says to enter a command line. So, i input the path of the document and run the macro. It works great! But now I need to get the Word document to print after it is opened. I wasn't sure how to do this. I have tried to create a macro in Word to automatically print the document but that didn't work. Then I used the RunCommand under macros in Access and selected PrintOut. I received an error message and I also tried the sendkeys. Nothing has worked. Anyone have any ideas on how to do this? Any help would be great! Thanks
I have a report with four subreports. If the subreports have no data I have a formula to put the word 'none' in the first field as follows:
=IIf(IsNull([Question]),"None",[Question])
I do a print preview and the word 'None' shows up and subreport looks good when I view just the subreport as well as when I view the full report.
When I print the subreport the text '#Error' prints. When I print the full report I just get a blank space.
I need the subreport to print with the word 'None' if there is not data. How do I accomplish? I tried the above formula both in the query and in the control source of the report. It just comes up blank when I put it in the query.
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 would like to have a button (cmdPrintIntroLetter) on my Client Details form that takes the client name, address and company data of the record that I'm currently viewing and putting it into an address box in a Word document.
e.g. when I contact a new customer and input their details into my form I want to then be able to send them an introductory letter (standard wording) from me with just the click of a button.
FAO: FirstName LastName CompanyName Address1 Address2 Address3 Town County Postcode
I've been faffing around with concatenating my address fields into an address textbox in a report but I really don't like using a report to write a letter, it just feels wrong - on every level.I also want another button (cmdEmailBrochure) which opens an email template using the records email address and inserting the name of the client into the body of the email.
What's is the exact syntax to print a subformB (within a formA) using VBA code? The code will be on the OnClick event of a button and the button is on formA.
Hi everyone. I have the following code attached to a text box.
Private Sub txtsearch_AfterUpdate() Me.lstsearch.RowSource = "Select [R&D ID#], [SKU#], [Project Name], [Construction level], [Manufacturer], [Hobbico Status], [R&D Work By], [Product Manager], [Desktopper]" & _ "From [Project Main]" & _ "Where [Project Name] like '*" & Me.txtsearch & "*'" & _ "OR [SKU#] like '*" & Me.txtsearch & "*'" & _ "OR [R&D Work By] like '*" & Me.txtsearch & "*'" & _ "OR [Product Manager] like '*" & Me.txtsearch & "*'" & _ "OR [Desktopper] like '*" & Me.txtsearch & "*'" & _ "OR [R&D ID#] like '*" & Me.txtsearch & "*'" Me.lstsearch.Requery End Sub
This code searched for matching text strings in a few different filed. It is working really well, but it would become much more helpful if instead of searching one single text string, I could enter two in the same box and it would perform the search based on matching both strings, that is, list all the records that have xxxx and xxxx in any of the fields checked.
How do I print the complete code of a project? If I select all the code with CTRL+A in the code window does it print all the objects of the project I'm in or I have to select each object from the drop down list at the top of the code window?
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 have lookup table I use to return names for various "Sales Class" codes.It all works good but if there is a code that isn't in the lookup table it leaves that field empty.I want it to return the word "Unknown" for any code that doesn't have a match.Here is the SQL:
Code:
SELECT [Data1].OrderNum, SalesClasses.[Name] FROM [Data1] LEFT JOIN SalesClasses ON [Data1].[Sales Class] = SalesClasses.[Code1];
Hi all I need to run a certain file from the form I create a button as follows Select in the categories "Applications" then select "Run Ms Word" I have tested it and it open Word but not even a blank page I then open the code as seen below and want to insert the filename but do not know where. Can someone please help me?
Private Sub Command35_Click() On Error GoTo Err_Command35_Click
Dim oApp As Object
Set oApp = CreateObject("Word.Application") oApp.Visible = True
I am creating a database for someone which includes a mail merged document with some data from the database. Is it possible to allow the user to open the document by clicking on a button that will be on the Switchboard in the database, so that they do not have manually open the document? Hope this makes sense!
Hello, I am a researcher creating critical editions of ancient texts by collating readings from several manuscripts (i.e. different mss all contain minor differences). I create my edition in Word and use footnotes to record the variant readings. I also have a database - created from the word file - in which I can add context to each variant e.g. decisions, history etc. So I have a word file containing the text and its variants uniquely identified with a footnote reference and a database with one table and a record per variant and where the variant records are also unique and share the same number as the footnote. I would very much like to be able to open a window on my variant form which displays the word file at the correct variant (i.e. footnote reference) location. This will make it easier for me to record my assessments of the variant in the dbase while looking at where the variant occurs in the text. Obviously I don't need to see the footnote window as I have this info in the dbase. I haven't got a clue how to do this and would appreciate any pointers. Many thanks in advance, Tim
I have a database with hyperlinks to open word documents on my network. If someone else has that word document open it will ask me if I want to notify or open in read only. However since upgrading to Access 2013, (from Access 2003), this sometimes freezes the database.
I am wandering is there a way to tell Access (or Word) to open the document in read only if there is someone using it already?
I have fairly large Access 2003 tables and forms on my job. I am curious if I can open word document off the form by using command button. Very often I need to put info off the form to word and sent it via e-mail to clients so I every time I have to keep a lot open word documents at the same time on my computer 10 or more that is slow pc down. I would like to have like this : on specific form I have command button and when i need to work with word document , click that button that will open specific word doc and when I am done I think I need a second command button to safe and close word document and so that i can attach it to e-mail and sent it out. So every time I need to work with word doc, I can open it off the form and close it also when I am done with it so no word doc would be open unnecessarily.
Hi all, Not sure if this is in the right section but heres my question.
How can i gett a button to open a word document and put in specific information. for example. to send a client a letter, the button would open a word doc with the specfic client data in it.
Also a button to start a mail merge with all client records held on the db.
I want to create a new word doc, do a saveas to a specific path and file name, allow the user to edit the new doc, and then close it and return to the Access app. I can create the doc but Word opens without opening the New Savedas Doc. using this code
Dim oApp As Word.Application Dim WordDoc As Word.Document Set oApp = CreateObject("Word.Application") Set WordDoc = CreateObject("Word.document") oApp.Visible = True WordDoc.SaveAs ("TS-" & Me.Scriptnum & ".Doc")
In access database, Is there anyone know how use macro to open a word document on a share drive..(example S:safetyRegulation.doc)?.
Here is what I did and it doesn't work.. Runapp command line: C:Program FilesMicrosoftOfficeOfficeWINWORD.EXE //S:safetyRegulation.doc. Is there any easier way to do this? Please advice..thanks Rob..
I was tasked to create an application where by the user enters keywords into an Access form, and when he clicks the button, it will run the keywords against the file names stored in the table and automatically open the Word document that is the best match.
I have created a table query called Directory, which contains FPath (Z:), FName (Document1.doc) and Directory (Z:Document1.doc).
Code: Private Sub Command2_Click() Dim wrdApp As Word.Application Dim wrdDoc As Word.Document Dim filepath As String Dim strSearch As String
If IsNull(Me.txtSearch) Or Me.txtSearch = "" Then MsgBox "Please type in your search keyword.", vbOKOnly, "Keyword Needed"
[Code] ....
This is the code that I am currently using to search and open the Word documents, however, this code only manages to open Microsoft Word program without loading any documents. Also, there are no error messages when I click the submit button.