I need to know how to add a custom, dynamic Autotext entry for Microsoft Word. I want to be able to Insert>Autotext>Header/Footer>"Last Friday" and have last Friday's date show up in the spot and keep it updated like inserting the Date Autotext updates each time the document is opened.
I have the VB code necessary to compute last Friday's date and return it as a String, but I am having trouble finding how to tie the function's output to a new Autotext entry.
It would also be acceptable to add a custom entry into the Insert>Field list as well.
There is another thread here
http://www.tech-archive.net/Archive/Word/microsoft.public.word.vba.beginners/2007-02/msg00050.html
This might have a solution for you.
Related
I am trying to create two fields in Microsoft Word. One that has a "created Date" (that I can manually enter) and the second that calculates the difference in days from created date to today's current day. It is to allow me to see how long an item has been worked on as I am using trying to build a schedule in word.
I am assuming a Macro needs to be created but I can't find any clear examples anywhere.
Thanks for your help
I'm working on a Excel application that will obtain data from my Entry form and import it into a Display sheet, both in separate worksheets.
The Entry form has a table to key in data via a combination of manual key-in, dropdown lists and vlookup functions. This table is then defined as EntryTable..
In the Summary form there is an SQL statement (SQL1) used to import the data from Entry to Display.
However every time I click the button, the Entry Date will not appear, and the Time changes its format to include date and time.
What's more for some reason the time format in Entry also changes as well. To add insult to injury.
Basically my question here is:
Why was Entry Date omitted in the search even though the SQL specifically stated to select all?
Why does the time always have to add a date in the format every time I try to import?
If anyone know what the issue is, please share with me. Because I'm all out of ideas and I'm losing my patience.
Situation:
I have some sheets in my QVW and two alternate selection states:
1. Standard (for selection of an arbitrary date in the reports)
2. PreviousDayFix (for sheets that shall display the data of the previous day only)
For 1.) the user can select the filters and for 2.) the fields are set by document triggers (on open document) and the filters are not displayed for the user, so he cannot change them.
Problem:
I have a report based on one of the "previous day sheets". When I distribute this report as PDF via E-Mail, it seems, that the document triggers are not executed. So the "previous day" will not be set correctly. So when someone opens the Document on 20th Jan, the date is set to 19th Jan. If he doesn't open it on 21st Jan, then the PDF report will stick on the 19th Jan.
I've seen, that you can select one of the following options in the report settings:
Current selection
Clear selection
Bookmark
But there seems to be no option: "use whatever the document triggers set".
How can I fix / workaround this?
Ok - I did not found an option in qlikview, but a very clean workaround.
Add a field to your calender IsYesterday with if(Date = today()-1, 1, 0)
Don't set the Day, Month, Year fields with the document trigger, but set the IsYesterday field to 1
Make sure, you ran the script at least once
Then it doesn't matter, if the PDF report distribution executes the trigger or not, because the filter stays the same. And since the data is reloaded, the IsYesterday-filter automatically adjusts to the correct date.
Because my question is not only valid for Dates, this answer is not only valid for dates, too.
Basically the trick is, to use a field, where you programatically implement the filter condition and return a boolean. Then you select that boolean (manually or with a document trigger) and save the QVW. Next time, the PDF report generates, the filter is applied.
i am developing an app for windows in vb net.
I am stuck in the last part which is the following and i would like some help on to where should i look or do.My question:I have one database in mysql called patient.each patient have the usual columns(name,surname etc..).Apart from all the columns there is one column called 'time' and another one called 'date'.I have also one datagrid where these values are displayed.When a new user is to be added,all the fields are filled and in the 'time' he fills the time of visit.I would like to ask if there is any way to restrict the range of time according to date...for example to be able in the beginning before adding the new patient,to say that in august 30 of 2014 the range of time for appointments is from 9 to 10.So when the new patient is added on that date ,to book only between this range every ten minutes eg 9:10,then 9:20 and so on until 10.
I am really stuck and been searching the last week for a solution ,so any ideas on the implementation would be appreciated.
Thank you in advance..If you need some of my code let me know.
If you want to restrict the input data, you have to use the DataGridView's CellValidating event. There you can check wether the input is ok or not. If it's not ok, you can set the ErrorText field of the edited row, where you can explain to the user what's wrong with his input.
Have a look at this HowTo from the MSDN.
Using Word 2010
We're creating a form in Word for leave applications. We have chosen all the relevant text fields to be filled out, and of course date fields.
We want the form to be able to be completed either digitally (using the date field) or printed and filled out. That is where the issue comes in because it fills the field in with a place-holder date.
I have contemplated creating a script that when printing, checks if the field has the placeholder date, if so, delete's it before printing.
Is there another way to have the date empty until filled in. Is there a format for a normal text box which could force a format similar to DD/MM/YYYY?