https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170612&feed=atom&action=history
Microsoft KB Archive/170612 - Revision history
2024-03-28T12:45:00Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170612&diff=353369&oldid=prev
X010: Text replacement - "&" to "&"
2020-07-21T11:29:47Z
<p>Text replacement - "&" to "&"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:29, 21 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l78">Line 78:</td>
<td colspan="2" class="diff-lineno">Line 78:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> If Selection.Type = wdSelectionNormal Then</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> If Selection.Type = wdSelectionNormal Then</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ' Get selected text and place it within quotation marks.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ' Get selected text and place it within quotation marks.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> SelectedText = Chr$(34) &<del style="font-weight: bold; text-decoration: none;">amp; </del>Selection.Text &<del style="font-weight: bold; text-decoration: none;">amp; </del>Chr$(34)</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> SelectedText = Chr$(34) & Selection.Text & Chr$(34)</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ' Move insertion point to end of selection.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ' Move insertion point to end of selection.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Selection.Collapse (wdCollapseEnd)</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Selection.Collapse (wdCollapseEnd)</div></td></tr>
</table>
X010
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170612&diff=342885&oldid=prev
X010: Text replacement - """ to """
2020-07-21T10:04:56Z
<p>Text replacement - """ to """</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:04, 21 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l85">Line 85:</td>
<td colspan="2" class="diff-lineno">Line 85:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Type:=wdFieldTOCEntry, Text:=SelectedText</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Type:=wdFieldTOCEntry, Text:=SelectedText</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Else</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Else</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> MsgBox <del style="font-weight: bold; text-decoration: none;">&quot;</del>The selected text is not valid for a TC field.<del style="font-weight: bold; text-decoration: none;">&quot;</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> MsgBox <ins style="font-weight: bold; text-decoration: none;">"</ins>The selected text is not valid for a TC field.<ins style="font-weight: bold; text-decoration: none;">"</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End If</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End If</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End Sub</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End Sub</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l105">Line 105:</td>
<td colspan="2" class="diff-lineno">Line 105:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></div></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></div></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>and then double-click the selected text to go to the <del style="font-weight: bold; text-decoration: none;">&quot;</del>Field codes: TC (Table of Contents Entry) field<del style="font-weight: bold; text-decoration: none;">&quot; </del>topic. If you are unable to find the information you need, ask the Office Assistant.<br /></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>and then double-click the selected text to go to the <ins style="font-weight: bold; text-decoration: none;">"</ins>Field codes: TC (Table of Contents Entry) field<ins style="font-weight: bold; text-decoration: none;">" </ins>topic. If you are unable to find the information you need, ask the Office Assistant.<br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For more information about adding a command to a menu, click Contents And Index on the Help menu, click the Index tab in Word Help, type the following text</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For more information about adding a command to a menu, click Contents And Index on the Help menu, click the Index tab in Word Help, type the following text</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l114">Line 114:</td>
<td colspan="2" class="diff-lineno">Line 114:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></div></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></div></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>and then double-click the selected text to go to the <del style="font-weight: bold; text-decoration: none;">&quot;</del>Add a command or other item to a menu<del style="font-weight: bold; text-decoration: none;">&quot; </del>topic. If you are unable to find the information you need, ask the Office Assistant.<br /></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>and then double-click the selected text to go to the <ins style="font-weight: bold; text-decoration: none;">"</ins>Add a command or other item to a menu<ins style="font-weight: bold; text-decoration: none;">" </ins>topic. If you are unable to find the information you need, ask the Office Assistant.<br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For additional information, please see the following articles in the Microsoft Knowledge Base:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For additional information, please see the following articles in the Microsoft Knowledge Base:</div></td></tr>
</table>
X010
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170612&diff=89909&oldid=prev
3155ffGd: importing KB archive
2020-07-18T15:35:19Z
<p>importing KB archive</p>
<p><b>New page</b></p><div><div id="nsbanner"><br />
<br />
<div id="bannerrow1"><br />
<br />
{|<br />
| Knowledge Base<br />
|<br />
|}<br />
<br />
<br />
</div><br />
<div id="TitleRow"><br />
<br />
= <span id="KB170612"></span>WD97: Macro to Create Table of Contents Entry Automatically =<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div id="nstext" valign="BOTTOM"><br />
<br />
Article ID: 170612<br />
<br />
Article Last Modified on 1/20/2007<br />
<br />
<br />
-----<br />
<br />
APPLIES TO<br /><br />
<br /><br />
<br />
* Microsoft Word 97 Standard Edition<br />
<br />
<br />
-----<br />
<br />
<div class="notice_section"><br />
<br />
This article was previously published under Q170612<br />
<br />
</div><br />
<div class="notice_section"><br />
<br />
<br />
<br />
</div><br />
<div class="summary_section"><br />
<br />
== SUMMARY ==<br />
<br />
The following macro example allows you to designate selected text as a table of contents entry without removing the text from the body of the document and without having to type the table of contents entry twice.<br /><br />
<br /><br />
'''NOTE''': Microsoft Word provides a method for marking table of contents entries. To do this, select the text that you want to mark as a table of contents entry and press ALT+SHIFT+O. However, you can also use the macro described in this article.<br />
<br />
</div><br />
<div class="moreinformation_section"><br />
<br />
== MORE INFORMATION ==<br />
<br />
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:<br />
<div class="indent"><br />
<br />
https://partner.microsoft.com/global/30000104<br />
<br />
<br />
</div><br />
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:<br />
<div class="indent"><br />
<br />
[http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS]<br />
<br />
<br />
</div><br />
You can assign the following macro to a menu, toolbar, or key sequence to quickly designate text to be included in a table of contents.<br />
<pre class="codesample"> Sub EnterTCField()<br />
Dim SelectedText As String<br />
' Selection must be text.<br />
If Selection.Type = wdSelectionNormal Then<br />
' Get selected text and place it within quotation marks.<br />
SelectedText = Chr$(34) &amp; Selection.Text &amp; Chr$(34)<br />
' Move insertion point to end of selection.<br />
Selection.Collapse (wdCollapseEnd)<br />
' Insert TC field.<br />
Selection.Fields.Add Range:=Selection.Range, _<br />
Type:=wdFieldTOCEntry, Text:=SelectedText<br />
Else<br />
MsgBox &quot;The selected text is not valid for a TC field.&quot;<br />
End If<br />
End Sub<br />
</pre><br />
When you have designated all of the table of contents entries with this macro, choose Table Of Contents from the Insert menu. Click Options and click to select the Table entry fields check box.<br /><br />
<br /><br />
Table of Contents entries or TC fields are automatically formatted as hidden text. To edit these entries, you must select either Show All or Hidden Text. To do this, do the following:<br /><br />
<br /><br />
<br />
# On the Tools menu, click Options.<br />
# On the View tab, click to select Field Codes.<br />
# Click to select the Hidden Text check box.<br />
<br />
For more information about Table of Contents Entry fields, click Contents And Index on the Help menu, click the Index tab in Word Help, type the following text<br />
<div class="indent"><br />
<br />
TC<br />
<br />
<br />
</div><br />
and then double-click the selected text to go to the &quot;Field codes: TC (Table of Contents Entry) field&quot; topic. If you are unable to find the information you need, ask the Office Assistant.<br /><br />
<br /><br />
For more information about adding a command to a menu, click Contents And Index on the Help menu, click the Index tab in Word Help, type the following text<br />
<div class="indent"><br />
<br />
menus, commands<br />
<br />
<br />
</div><br />
and then double-click the selected text to go to the &quot;Add a command or other item to a menu&quot; topic. If you are unable to find the information you need, ask the Office Assistant.<br /><br />
<br /><br />
For additional information, please see the following articles in the Microsoft Knowledge Base:<br />
<div class="indent"><br />
<br />
[[../163547|163547]] WD97: How to Create Custom Toolbars and Toolbar Buttons<br /><br />
<br /><br />
[[../173707|173707]] OFF97: How to Run Sample Code from Knowledge Base Articles<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div class="references_section"><br />
<br />
== REFERENCES ==<br />
<br />
For more information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:<br />
<div class="indent"><br />
<br />
[[../163435|163435]] VBA: Programming Resources for Visual Basic for Applications<br />
<br />
<br />
</div><br />
<br />
</div><br />
<br /><br />
<br />
Additional query words: vb vba vbe<br />
<br />
Keywords: kbdtacode kbhowto KB170612<br />
<br />
<div class="footer"><br />
<br />
<br /><br />
<br />
<br />
-----<br />
<br />
[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]<br />
<br />
<span>© Microsoft Corporation. All rights reserved.</span><br />
<br />
<br />
</div><br />
<br />
</div></div>
3155ffGd