﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://schneegans.de/dtd/xhtml1-strict.dtd"[]><html lang="de" xml:lang="de" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><head><meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /><title>Keywords-Metatag mit VBA erstellen</title><link href="http://schneegans.de/xp/?url=http%3A%2F%2Fschneegans.de%2Fstyle%2F&amp;ct=application%2Fxml" rel="Stylesheet" type="text/css" /></head><body><table id="DankeThilo" style="border-collapse: collapse; margin: 20px auto; background-color: #EEE; border: 5px #EEA000 solid; padding: 10px;"><tr style="border: none;"><td rowspan="1" colspan="1" style="border:none; text-align: center; padding: 20px; font-size: 6em; font-weight: bold; color: #EEA000;">Danke, Thilo!</td></tr><tr style="border: none;"><td rowspan="1" colspan="1" style="border:none; text-align: right; padding: 3px;"><a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fwww.steinhoefel.de%2Fblog%2F2010%2F09%2Fweitermachen-thilo.html&amp;ct=application%2Fxml" style="text-decoration: none;" class="Offsite">...</a></td></tr></table><div class="Header"> <h1>Keywords-Metatag mit VBA erstellen</h1> <p class="Breadcrumb">» <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fschneegans.de%2F&amp;ct=application%2Fxml">schneegans.de</a> » <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fschneegans.de%2Ffrontpage%2F&amp;ct=application%2Fxml">Microsoft FrontPage</a> » <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fschneegans.de%2Ffrontpage%2Fvba%2F&amp;ct=application%2Fxml">FrontPage und VBA</a> » Keywords-Metatag mit VBA erstellen</p> <div id="_ctl0_NewsgroupAnnouncement" style="color: #B22; border: thin solid #B22; padding: 5px;"> <p>Microsoft hat angekündigt, seine öffentlichen Newsgroups (<strong>microsoft.public.de.*</strong>) <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fpatch-info.de%2Fartikel%2F2010%2F05%2F05%2F849&amp;ct=application%2Fxml" class="Offsite">abzuschalten</a>. Die beiden von mir betreuten Gruppen <strong>microsoft.public.de.frontpage</strong> und <strong>microsoft.public.de.expression.web</strong> werden bereits zum 1. Juni 2010 geschlossen.</p> <p>Ich empfehle meinen Besuchern sowie allen Anwendern von FrontPage und Expression Web, in die deutschsprachige Webautoren-Newsgroup <strong>de.comm.infosystems.www.authoring.misc</strong> zu wechseln. Beachten Sie auch meine <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fmicrosoft.public.de.frontpage%2Fmsg%2Fc1e8d3bbf0542ddd&amp;ct=application%2Fxml" class="Offsite">Ankündigung in den Newsgroups</a>.</p> </div> </div><div class="Content"> <p class="Summary">Mit einem einfachen VBA-Makro lassen sich Wörter eines HTML-Dokuments ins Keywords-Metatag aufnehmen.</p> <p>Die <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fwww.heise.de%2Fct%2F&amp;ct=application%2Fxml" class="Offsite">c't</a> schreibt in Ausgabe 24/00 im Testbericht zu <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fwww.adobe.de%2Fproducts%2Fgolive%2F&amp;ct=application%2Fxml" class="Offsite">Adobe GoLive 5.0</a> auf Seite 96 folgendes:</p> <blockquote><p>Vorbildlich geht GoLive mit dem Meta-Tag "Keywords" um. Der Befehl "Als Schlüsselwort aufnehmen" überträgt das gerade markierte Wort in das entsprechende Header-Element.</p></blockquote> <p>Das ist vermutlich ein Meilenstein in der Software-Entwicklung. Mit FrontPage geht es allerdings auch:</p> <pre xml:space="preserve" class="Snippet">
<code>Public Sub As_Keyword()
  
  If ActiveDocument Is Nothing Then
    MsgBox "Sie müssen zuerst ein Dokument öffnen.", _
     vbOKOnly Or vbExclamation
    Exit Sub
  End If
  
  With ActiveDocument
  
    Dim keyword As String
    keyword = Trim(.selection.createRange.Text)
    If keyword = "" Then
      MsgBox "Sie müssen zuerst ein Wort markieren.", _
       vbOKOnly Or vbExclamation
      Exit Sub
    End If
  
    If .all.tags("META").Item("KEYWORDS") Is Nothing Then
      .all.tags("HEAD")(0).insertAdjacentHTML _
       "BeforeEnd", "&lt;meta name=""Keywords"" content=""" &amp; _
       keyword &amp; """&gt;"
    Else
      .all.tags("META").Item("Keywords").setAttribute _
       "content", .all.tags("META").Item("Keywords"). _
       getAttribute("content") &amp; ", " &amp; keyword
    End If
  End With
End Sub</code>
</pre> <p>Das ist alles. Und kostet zusammen mit FrontPage nicht über 500,- DM. Ein wesentlich umfangreicheres <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fwww.janko.at%2FFrontpage%2FMetatagsBearbeiten%2Findex.htm&amp;ct=application%2Fxml" class="Offsite">Makro</a> für die Verwaltung von Meta-Tags hat <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fwww.janko.at%2F&amp;ct=application%2Fxml" class="Offsite">Otto Janko</a> entwickelt.</p> <p>Natürlich interessiert sich keine brauchbare Suchmaschine noch für Meta-Tags.</p> </div><div class="Footer"> <em>URL:</em> http://schneegans.de/frontpage/vba/keywords-metatag/<br /><a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fschneegans.de%2Fsv%2F%3Furl%3Dhttp%3A%2F%2Fschneegans.de%2Ffrontpage%2Fvba%2Fkeywords-metatag%2F&amp;ct=application%2Fxml" hreflang="en" class="Offsite">XHTML überprüfen</a> · <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fjigsaw.w3.org%2Fcss-validator%2Fvalidator%3Furi%3Dhttp%3A%2F%2Fschneegans.de%2Ffrontpage%2Fvba%2Fkeywords-metatag%2F&amp;ct=application%2Fxml" class="Offsite">CSS überprüfen</a> · <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fschneegans.de%2Fxp%2F%3Furl%3Dhttp%3A%2F%2Fschneegans.de%2Ffrontpage%2Fvba%2Fkeywords-metatag%2F&amp;ct=application%2Fxml" class="Offsite">Als <code>application/xml</code> laden</a><address><em>Autor:</em> <a shape="rect" href="http://schneegans.de/xp/?url=http%3A%2F%2Fschneegans.de%2Fchristoph%2F&amp;ct=application%2Fxml">Christoph Schneegans</a> (<a shape="rect" href="mailto:Christoph%20Schneegans%20%3CChristoph@Schneegans.de%3E">Christoph@Schneegans.de</a>)</address> </div></body></html><!-- XHTML Proxy has successfully processed this page. -->