Fields in MS Word: Create a partial TOC from another document using bookmarks and the RD field

Diskutiere und helfe bei Fields in MS Word: Create a partial TOC from another document using bookmarks and the RD field im Bereich Microsoft Office im Windows Info bei einer Lösung; Hi everybody, Image two cases: (1) If I would want to compile a partial TOC just for a section, I would create a bookmark for this entire section... Dieses Thema im Forum "Microsoft Office" wurde erstellt von AndreasPutlitz, 25. Januar 2019.

  1. Fields in MS Word: Create a partial TOC from another document using bookmarks and the RD field


    Hi everybody,


    Image two cases:


    (1) If I would want to compile a partial TOC just for a section, I would create a bookmark for this entire section and then use a \b switch after the TOC field, adding the name of this bookmark.


    (2) If I would want to compile a TOC derived from the content of document A in document B, I would add a TOC field in document B, and directly afterwards add an RD field with the filename of document A.


    Both solutions work perfectly.


    (3) Now I want to have a partial TOC of a section of document A in document B. I add a bookmark for the respective section in document A. Then I add a TOC field in document B using a \b switch with the name of the bookmark in document A. And then finally I add an RD field right under the TOC field in document B.


    { TOC \b Chapter1 }

    { RD "writing-template.docx" \f }


    However, in this case, it tells my that the bookmark has not been defined. It looks like, Word is somehow not capable of passing on bookmarks using the RD command? Is that correct?


    Any idea on how to fix this? Any workaround to create partial TOCs across documents?
     
  2. Lene Fredborg Win User

    Falscher Inhaltsverzeichniseintrag durch Feldfunktion

    Hi Alvar,

    No doubt that the solution suggested by Paul Edstein (posted by Lisa) is good since it makes the problem go away.

    I have created a macro that can be used as an alternative. The macro does not fix the problems within the AutoText fields but it fixes the problem in the table of contents (TOC). The macro below assumes that only one
    TOC is found in the document. The macro:

    1. unlocks the TOC field
    2. updates the TOC field (will bring the undesired paragraphs back in the TOC)
    3. finds and deletes the undesired paragraphs in the TOC by examining the TOC bookmarks that the hyperlinks in the TOC point to
    4. locks the TOC field

    Further details are included in comments in the macro below.

    ------------------MACRO START-----------------

    Sub UpdateTOC_RemoveFakeItemsFromTOC()

    'Fake items are paragraphs with hyperlinks to TOC bookmarks

    'that are erroneously added at the end of the field code of AutoText fields that insert a numbered paragraph via a conditional field construction

    Dim oToc As TableOfContents

    Dim oDoc As Document

    Dim oHL As Hyperlink

    Dim lngDeleted As Long

    Const cstrTitle As String = "Update TOC and Remove Fake Items From TOC"

    If ActiveDocument.TablesOfContents.Count = 0 Then

    MsgBox "No TOC found in document.", vbOKOnly, cstrTitle

    Exit Sub

    End If

    Set oDoc = ActiveDocument

    Set oToc = oDoc.TablesOfContents(1)

    lngDeleted = 0

    Application.ScreenUpdating = False

    'Unlock TOC field if locked - TOC field itself is first field, hyperlink fields come after

    oToc.Range.Fields(1).Locked = False

    'Update TOC

    oToc.Update

    'Check all hyperlinks in TOC - if length of bookmarked range the hyperlink points to is an empty string

    'then delete the paragraph with that hyperlink from the TOC

    For Each oHL In oToc.Range.Hyperlinks

    If oDoc.Bookmarks(oHL.SubAddress).Range.Text = "" Then

    oHL.Range.Paragraphs.First.Range.Delete

    lngDeleted = lngDeleted + 1

    End If

    Next oHL

    'Lock TOC

    oToc.Range.Fields(1).Locked = True

    Application.ScreenUpdating = False

    Application.ScreenRefresh

    MsgBox "Finished updating TOC. " & lngDeleted & " paragraphs with fake references deleted. The TOC field has been locked.", vbOKOnly, cstrTitle

    Set oDoc = Nothing

    Set oToc = Nothing

    End Sub

    ------------------MACRO END-----------------
  3. Lisa Wilke-Thissen Win User

    Adress-Etiketten mit Word 2007 (Win7): "Etiketten aktualisieren" im Menü "Sendungen" funktioniert nur in der ersten Zeile

    Hi Doug,

    Macro to overcome the problem with propagation of mail merge field fields with a label type mail merge when using a Tablet PC and some other Computers that have Tablet PC Functionality available:
    Thanks for posting the code here :).

    Cheers,

    Lisa [MS MVP Word]
  4. Robin Huber Win User

    Unlink Fields in Excel and PowerPoint

    The field don't update anymore and is simply text. I need to convert multiple PDFs and they'd have the original things of the document not the updated fields.

    The Code in Word: ActiveDocument.Fields.Unlink
  5. Gunter Avenius Win User

    Nachschlagdaten von Quelltabelle erscheinen nicht in der Auswahl in Zieltabelle

    Hello, > "renounce lookup fields in tables."
    - Have you come out without? Yes!
    "But as soon as I (from the list on the right side of the screen) a FeldX (not the
    > lookup field) draw from table1 into the form, any input into the blocked form.
    If I understand you Correctly, you drag a field from the lookup table into a form did makes the record source of the form not updatable and THEREFORE it is "blocked"
    Possibly You can therefore upload each a little Example I throw a look at it.

    Greeting

    Gunter - Access FAQs:

    http://www.donkarl.com
  6. CharlesKenyon IA Win User

    WORD MACRO: Search for date fields and replace result

    Hi Robin,

    The simplest way is to toggle the display of field codes and then search for ^d DATE. If you are on a Windows computer you would toggle the display of the field code using the keyboard shortcut Alt+F9 (or, on some computers Fn+Alt+F9). Are you planning on doing
    this with a macro? Your title would appear to request this.

    Are your fields DATE fields or CREATEDATE or SAVEDATE or PRINTDATE? See my page on the different date fields in Word.

    http://addbalance.com/word/datefields1.htm

    What is it you want to replace them with?

    This forum is a user-to-user support forum. I am a fellow user.

    I hope this information helps.

    Please let me know if you have any more questions or require further help.

    You can ask for more help by replying to this post (Reply button below).

    Stay well
  7. User Advert


    Hi,

    willkommen im Windows Forum!
Thema:

Fields in MS Word: Create a partial TOC from another document using bookmarks and the RD field - Microsoft Office

Die Seite wird geladen...

Fields in MS Word: Create a partial TOC from another document using bookmarks and the RD field - Similar Threads - Fields Word Create

Forum Datum

Select from Dropdown menu if certain value is in another field

Select from Dropdown menu if certain value is in another field: Hi guys and thanks in advance.I am trying to create an if formula, that if a certain value is selected from a dropdown menu, another field will display a certain value in a different drop down...
Microsoft Office 15. Februar 2022

WORD MACRO: Search for date fields and replace result

WORD MACRO: Search for date fields and replace result: Hi I'm working on a solution to search date fields in Word and replace the result. Replacing the result should be easy but how can I search for date fields?
Microsoft Office 9. September 2020

WORD VBA: SHOW FIELD CODE OF ONLY ONE FIELD

WORD VBA: SHOW FIELD CODE OF ONLY ONE FIELD: Hello How can I show the field codes for only one or selected fields in Word with VBA? Thanks for your help!
Microsoft Office 8. September 2020

Unlink Fields in Excel and PowerPoint

Unlink Fields in Excel and PowerPoint: Hello How can I convert the fields dates, path... in powerpoint and excel to text? I know there's a chance to do this in word and it works fine. But how can I do it in powerpoint or excel? The...
Microsoft Office 16. Juni 2020

equation-editor fields in word-document: not readable (Mac-user)

equation-editor fields in word-document: not readable (Mac-user): Dear Community, I have the following problem in word for mac. If I open a word-file which includes a lot of equation-editor-fields the mathematic formula in these fields are not readable. The...
Microsoft Office 13. November 2018

SharePoint: Edit an issue and get greyed out fields

SharePoint: Edit an issue and get greyed out fields: I created in SharePoint online an issue-tracking library. The Enduser will fill out the form. But if the Enduser want to add an comment he has to edit the issue. In this edit-form I want greyed...
Microsoft Office 25. Juli 2017

Field Medic

Field Medic: Field Medic [IMG] Field Medic is the premier diagnostic application for Windows Phone. This tool allows easy collection of device information and ETW logs right from your device. Field...
Tools + Produktivität 26. März 2015
Fields in MS Word: Create a partial TOC from another document using bookmarks and the RD field solved
  1. Diese Seite verwendet Cookies, um Inhalte zu personalisieren, diese deiner Erfahrung anzupassen und dich nach der Registrierung angemeldet zu halten.
    Auf dieser Website werden Cookies für die Zugriffsanalyse und Anzeigenmessung verwendet.
    Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies.