Microsoft Word can be used for the following purposes − By default, documents saved in Word 2010 are saved with the. The macro I posted contains code to update all the fields in a document.Microsoft Office Word 2010 allows you to create and edit personal and business documents, such as letters, reports, invoices, emails and books. Because there are no pages, when text flows to a further page, there is nothing to trigger the page count. If you use fields in the document to display the page count, then you are going to have to force an update to those fields, which, as you have found, do not update automatically. Note there are no 'pages' in a Word document. If you want to use a building block, save the page as an autotext entry in the template: 17114 However your supplied example is a template, so presumably you have considered the implications of using it. Come to that macros in documents create a problem also as there is no way to force users to allow them to run. You can then select the last table rather than the previous 'page'.Īrguably a better option would be to use a building block to holds the repeatable information, but as building blocks must be stored in templates, this is not an ideal solution for forms you may be distributing. If you want it to copy a text of variable length that might flow to more than a page, then you need to create a container for that text that can be copied as a whole. This copies the previous 'page' to immediately before the content control that operates as a button. The macro I posted is based on the information and the document you originally supplied. If ActiveDocument.SelectContentControlsByTitle("Main1").Item(1).ShowingPlaceholderText Then Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl) Then you can add to Greg's macro to process the content control 'Button' when it is clicked. While Not (oStory.NextStoryRange Is Nothing) Set orng = ActiveDocument.Bookmarks("\page").Rangeįor Each oStory In ActiveDocument.StoryRanges Selection.GoTo What:=wdGoToPage, Which:=wdGoToPrevious, Count:=1, Name:="" Name the 'button' content control "NewPage". It puts a copy of the previous page before the 'button' and updates the fields. The basic code for 2 and 3 could be as follows. Who knows this might help someone in need. This is a forum right, its worth to try and open for discussion. Trust me i try to search the google all the time for this with different keyword, but can't find one related to my questions. I mean if it is really possible on doing that, it might be worth to try and ask from the masters. Since i don't know much about vba code, i can't test it alone. Well to be honest, this is just for experimenting word vba capabilities. Now i know im asking a lot and it seems like im asking you guys to do all of this for me. I want it to be automatic updated but i cant find any suitable tutorial anywhere. The only problem is F9 is needed for it to be updated. I have try them using numpages and stuff. if you see this line "THIS QUESTION PAPER CONTAINS 2 PAGES INCLUDING COVER PAGE" and the there is the number there. This button will only show one input text and when the user click ok then button will gone, the text will replace the button instead and the 2 content control will be available below the previous buttonģ) This is an extra and might not be related but, still if you guys help me i would appreciate it. This new section will have the same 2 type of content control like the existing one. Since it has related with VBA and may need high knowledge of VBA, i really need some help because i really weak on it.Ģ) Second problem is i want to create a button on every end of the page, in order to let user create new section. My problem is prioritize the instruction so that it MUST be filled first and CANNOT be null in order to write a questions on the content control below. Can't find any suitable tutorial for my needs so i decided to ask here if it's allowed.ġ) If you downloaded my attachment, as you can see i have 1 part where it writes "Instruction" and below it is a content control which i use to write a questions there. i have 3 common problems here that i got stucked with almost a month. I am currently trying to create a macro template for examination paper that will strictly conditioning some section which needs to be input first before filling the others.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |