Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Auto Chng to HTML Title Tag

    Hi All,

    (Alan M-are you there?)

    I posted a problem in <post#=483730>post 483730</post#> dealing with text in the task bar buttons for each open window, regardless if there's one button per window or they were grouped (and tabbed browsers weren't the answer either). The problem:
    ****
    I have 4 cases that I got from a web site that I converted to Word for numerous reasons. These are all open at the same time since they're related (District Ct, Appeals Ct, Supreme Ct for same case). I may also have 2-3 cases that are cited in the main case(s) but are saved web pages.

    The problem is what's in the task bar buttons and knowing which to click to restore the desired window. The Word buttons have the file name at the beginning of the button. Moreover, if I hover over them, the full doc name followed by "Microsoft Word" is shown. So it's easy to know which button to click in the Word cases.

    It's the 2-3 IE windows that are my problem. They all say "Document - Microsoft Internet Explorer" when I hover or just look at the button. Nothing of the file name is reflected in the button. Worthless.
    ****

    One solution recognized that the first part of the task bar button comes, for IE, from the title tag. This particular site sets the title tag to a generic name and XP throws in the name of the program (MS IE) - of little use in determining which button to click. It would be much more useful if the button reflected the contents of the page, ie the case name. Turns out, I use the case name as part of the file name when I save the page.

    I tried Leif's suggestions of changing the title tag thru Notepad and thru Word. While Word makes things very easy (the title tag is accessible thru file properties, therefore suggesting VBA automation may be possible, altho beyond my means), Word adds bloat to the file. Just opening an HTML file in Word and changing nothing can add 4K-8K.

    But the real bottom line is that I do not want to go back to my existing 40-50 cases to manually change the Title tags. So I posed a followup:
    ****
    Is there a way to do either one of the following:
    - during the Save As process in IE, have a dialog pop up to ask for a value for the title tag and make the change as part of the process; I've noticed that there can be Java Script in the saved page (obviously put there by the page author) and add-ons for IE so don't know if either is useful. Either way, it's beyond my means.
    - create some kind of script that can be accessed via an htm file's context sensitive menu or Send To menu that shows a dialog box with the file name (just a reminder of the file that I've already named), shows me the current title tag (not really rqd), provides me with a blank fill-in box for my own title tag, overwrites (or creates) the title tag with my value, saves the file and exits.

    The 2 ideas could be combined into one. For example, open one of my saved cases/files in IE (as normal), click on a button/menu item that resets the title tag (w/o having to view the source), and saves the source. The existence of a file name could be checked as a candidate new title tag.
    ****

    So here's the challenge: a quick way of changing/creating a Title tag (very easy to find in the source) in an HTML file so that the task bar button reflects something meaningful.

    This could be considered for posting to
    - Word, although I'm somewhat against a Word solution because of the bloat altho the VBA automation is attractive
    - FrontPage, although I don't think of this as a problem with authoring
    - IE

    but I've decided to post here. Especially since I've seen other posts dealing with software for working with tags in mpeg or jpeg files.

    TIA

    Fred

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Chng to HTML Title Tag

    Fred, a couple more thoughts on using Word:

    1] It seems to me that if you save a web page using the IE route of File > Edit with Microsoft Word for Windows, the save the document from Word, the file automatically gets the original web page title as the Word document title. (i.e. if I save the Google homepage, it has a Title of 'Google')

    2] A macro to add a title to the document properties in Word can't be that difficult if I can manage it!
    Try something like:

    <code>Sub SetDocTitle()
    GetTitle = InputBox(prompt:="Enter Document Title...", Title:="Document Title")
    With Dialogs(wdDialogFileSummaryInfo)
    .Title = GetTitle
    .Execute
    End With
    End Sub</code>

    I'm not trying to push you towards Word in particular, but 4-8K of added bloat isn't as bad as I feared it could be!

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Auto Chng to HTML Title Tag

    Hi Leif,

    Thanks for the additional thoughts.

    I also tried an experiment along your google lines. I took an existing saved web page, opened it in IE, did a File | Edit with Word, changed the properties for the title in Word, saved the file, and exited Word. When I did a refresh in IE, the new title showed up in the title bar and the task bar button. Certainly using a macro would make the change easier. What would even be nicer is if the macro could use the title for saving the file since I ideally would have the file name be the same as the Title Tag (that way, the Task Bar Button would be exactly like the file name, which is what you get with Word or NotePad files). This was with a 3rd file and again about 4K was added.

    One of the drawbacks to opening a web page with Edit with Word is that the process also restores any minimized Word windows. As said in my earlier post, I have 4 of them opened but minimized until I need to refer to one of them. This is not good.

    I also tried the experiment with a new web page never saved. Went to the cnn.com web site and saved the entire home page in IE. The main page was 71K and the supporting folder was 167K (for my cases, I only save the main page since it's only text).

    I then went into Edit with Word. In addition to restoring all my Word windows, it took some time to open. When it did, the file was in read-only mode (unlike when I opened an existing page already saved on my HD). I then saved this with a Save As. No choice of saving Complete or HTML Only as there is in IE. So I wondered what I was getting. When I re-opened the file, all was there (all the pics ala the gif, jpeg, css). And the file was only 200K.

    I then tried again with Edit With Word. Again, restore all windows, long delay, and read only. This time I did a Save As Web Page. Again no choice of Complete vs HTML Only. But all was there. File was 211K.

    So maybe this is anti-bloat.

    Saving in IE as a Web Archive resulted in 312K (but I did it a few minutes later and had to re-open the CNN page so maybe something had changed that was not apparent). But this is a big increase.

    Now here's the BONUS of using Word (at least 2003): when doing either a Save As, where Word recognizes the file as an htm file, or a Save As Web Page, there's a button right on top of the file name box called "Change Title". Guess what that does? You got it. No need even for the macro. But there seem to be 2 drawbacks when opening the file saved either way:
    - it looks like IE or Word is opening momentarily: I can see a window opening with the full path name of my Word doc but there's an IE icon on the left of the title bar. Then the Title Bar switches to my title tag with IE open. I'm not sure if Word is actually opening (I don't want to try a "true experiment" since I have 4 Word windows open right now and don't want to close them). The icon in Win Exp for these files is a "W" inscribed over a web page with a dot in the middle (not the normal blue "e"). That's why I think Word may be opening before it is hidden (kind of like opening a pdf file in IE - Acrobat Reader is actually opened).
    - I can no longer use Edit With Word in the IE window in case I want to change the title tag. In fact, the File menu does not even have this as a choice; it has a grayed-out "Edit" only item.

    So, using your approach may have some benefits. But I don't want to go thru this for my 40-50 existing files. I'm still hoping for some kind of IE add-in or script. Certainly going thru all files in a folder and performing an action in VBA is not hard. But I'm not sure if I like the Word-approach.

    Let's see what else comes our way. Thanks for the idea.

    Fred

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •