Edit tables in the footer of word document - vba

i need to make a program to edit some tables in the footer of a word document. I read something about tables in word : Can we access a word table by it's name and not index using vba?
But my problem is i have several tables in my footer, and i cant add bookmark because it depends on how many sheets will have my .docx
Here what is look like my footer :
Do you have any idea how can i do it ?
Thanks

Thanks to #Timothy Rylatt, it's gonna be help me a lot !
You would do better to construct a template that contains the standard elements you need, such as headers and footers. If you use DocVariable or DocProperty fields to display data in the footer you don't need to access the footer at all. Just update the value of the property or document variable then update the fields. –

Related

How can I change Access hyperlinks with VBA?

I've done some extensive research and realize this is not an easy task.
I need to change many hyperlinks in different tables from P:\Library\Folder... to I:\Folder...
I think I can change the field type to long text, find and replace, change type back to hyperlink.
Table Find/Replace dialog will work on Hyperlink field if there is no DisplayText component in hyperlink string.
In either case, an SQL UPDATE action will work, like:
CurrentDb.Execute "UPDATE table SET field = Replace([field], 'P:\Library\', 'I:\')"
It is possible to have hyperlink functionality on form and report in ReportView without Hyperlink type field. Of course this will require alternate method than hyperlink field interface to enter file path into text field - probably with VBA executing File System Object dialog. Hyperlink click will not be possible in table but since users should not interact with tables and queries, just forms and reports, this should not be an issue.

Can I use the Shrink Method for the whole document in word

I don't know anything about code. I work with e-learnings in Storyline 3. I sometimes localize these e-learnings and use the translation tool in Articulate which basically exports an MS Word file. Sometimes the target languages are longer and I need to decrease the font size by percentage for the whole document. Usually, there are at least 3 different font sizes that I need to decrease accordingly. I am wan to develop a macro that I will use for multiple documents.
I couldn't find a way to do this by percentage, but looks like the Shrink or Grow Methods will do the work! I found this code in the reference page but looks like it works only for a selected object. The issue is that the exported MS Word file is in a table with each text box in the storyline separated to a cell. When I select the whole table it does not work.
If Selection.Type = wdSelectionNormal Then
Selection.Font.Grow
Else
MsgBox "You need to select some text."
End If
Could you please help me and let me know if this would be possible for the whole document, or the selected table? It would be very much appreciated. Thanks in advance.
It is unclear from your question whether the table in the Word document contains the actual text boxes or just the text they contain.
If it is just the text then Shrink may work. I tested this on a document with a single table containing only text:
ActiveDocument.Range.Font.Shrink

Replace a blank before a table page break Word VBA

I uncheck "Allow row to break across pages" for a table's properties So, the table is shown on a new page to ensure that all the content is on one page, this works fine. But Word generates a blank space before the page break, I need to replace it with some text for a legal reason. I can't use a watermark or shapes because un Oracle BI Publisher only prints it on PDF and I need to export it to a docx.
The data is dynamic, so sometimes the text before the table and the text inside the table may change.
Current Version https://imgur.com/a/FTx0q
I need some like this https://imgur.com/a/ySitL
MS Office support told me that it can't be done with Word...
Maybe with VBA code?
Update
Thanks Cindy for your help.
I have a table into another table many paragraphs, checkbox etc and they are fitting on a new page. It's working.
I understand there isn't a page break.
It's Paragraph mark.
But what I need to do is insert a kind of mark, a text like XXXX,-----------, Instead of leaving "free space",
It's a requirement not change the font size or another text format.
For a legal requirement, some paragraph must fit on a new page and "blank spaces" replaced by a kind of mark.
I can't hard code it because in several cases not all the paragraphs or section in a page will be shown and I don't know by default when a new page is needed.
I am available to use macros or anything.
What you could do is insert a page-size table into a textbox in the page header and format the body text with a white background. The table will thus be hidden behind any text on the page, but not otherwise (provided you don't pad unused space with empty paragraphs, etc.).

Update a field in Word 2013 using VBA

I created a word document where I use fields (with Document properties) in the text, in the Footers but I also created an Word Art object with the Title-field in it.
I can Update the fields in the document using:
ActiveDocument.Fields.Update
For the Footers I use the PrintPreview
ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview
But none of those updates my Field in the Word Art Object.
How can I update this?
A wordart object is a shape, is it really the case, that a word art object can contain a field instead of just overlaying? Can you put out some more information/ did you double check if the field may have been updated but the content stays the same?
I have found a suitable work arround in Word for my problem.
It is not realy neccesary to use Word Art, I can use the same with "Text Effects and Typography"
I am still curious if there is a real solotion for this, but for now it works dor me

VBA named range in Word?

Is there a way to put invisible markers or id's in a document such that I can
get quick access to a fragment (paragrahp, table), in a way similar to the DIV/id combination used in HTML documents?
Yes, I can use bookmarks to point to a specific location in the document, but they do not the include the fragment itself, I'd be using two bookmarks, one to mark the start and the other for the end. Essentially what I'm looking for is a Word equivalent for named ranges as they are defined in Excel.
Any ideas?