Solved

make a macro...

Posted on 2001-08-17
18
293 Views
Last Modified: 2013-12-24
On my site whenever I put up a adobe pdf, or word or excel file I also put up a little graphic. They say that if you do this to also populate the ALT tag. This makes for extra steps. I know I can copy and paste from another area however sometimes it causes problems.

I would like to get a macro that places the image and populates the ALT tag. As an added bonus have the macro resize to 20x20 pixels and hyperlink to a webpage.

Most importantly please put comments in of what is going on. I will have to adjust for the page.

COMMENTS only. I will accept an answer.
0
Comment
Question by:j_powers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 5
  • 2
18 Comments
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6398520
There are a couple of site which illustrate how to write macros in FP using VBA....Do you have VBA installed?

http://www.zdnet.com/devhead/stories/articles/0,4413,2473530,00.html

http://support.microsoft.com/support/kb/articles/Q237/5/85.ASP

0
 
LVL 5

Author Comment

by:j_powers
ID: 6398875
Yes I do have the VB installed. However (and do not take this the wrong way) I don't want to learn how to write a macro. I went that way already and it got my head spinning.

I just need the code for the process and I will make the adjustments.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6398992
hmmmmm.....well...I personally have never done it before, but I'm willing to give it a try.

However, before I do, may I make a suggestion?

Post a 0 point questions in the MS Office & Visual Basic ta's pointing those experts to this q.

Dollars to Donuts they will be able to do it faster than I will.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6453354
Hi j_powers.

Sorry to take so long to get back to you.  It is very busy over here in ClassyLinks land and I was hoping another expert would jump in.

Here is a macro that will allow you to scan for the alts (among other things)

http://www.solution-shelf.com/CodeTips/TP_PageComb.htm

You can modify the macro to input your alt tags & sizes automatically by changing the line that spits out the error.  It is quite well documented.

What looks even better though is the add-in:

http://www.solution-shelf.com/FrontPage/ErrOmi/EO_FAQ.htm

HTH
0
 
LVL 5

Author Comment

by:j_powers
ID: 6454175
Thanks, but I have already seen that program. It is nice but I need something a little bit more customizable.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6454280
More cutomizable than the macro....that would be tough.


Using the macro above as a guide, I did this:

Sub ClassyLinks_AltTags()
'=================

' FrontPage object variables
Dim imgElement As FPHTMLImg

Dim X As Long
   
   
    ' make sure PageWindow reference is Valid!
    If Not (ActivePageWindow Is Nothing) Then
   
        ' CHECK each Image for Alt text and Size parameters
        For Each imgElement In ActiveDocument.Images
        imgElement.alt = "imageName or Description Here"
        imgElement.Height = "20"
        imgElement.Width = "20"
        Next
    End If
End Sub

It doesn't link to a web page, but perhaps you get the idea.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6457708
Is that getting closer to what you want j_powers?
0
 
LVL 5

Author Comment

by:j_powers
ID: 6458150
the imgElement.alt=

How would you point that to make it the image name?

So if the image is file.gif, I want the alt to say file.gif.

Also is there a way to make that a hyperlink to, lets say, yahoo.com?
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6458248
Ok...autopopulated the alt tag:

Sub ClassyLinks_AltTags()
'=================

' FrontPage object variables
Dim imgElement As FPHTMLImg

Dim X As Long
   
   
    ' make sure PageWindow reference is Valid!
    If Not (ActivePageWindow Is Nothing) Then
   
        ' CHECK each Image for Alt text and Size parameters
        For Each imgElement In ActiveDocument.Images
        imgElement.alt = imgElement.src
        imgElement.Height = "20"
        imgElement.Width = "20"
        Next
    End If
End Sub


The hyperlink is a little more difficult.  Will each one link to the same URL?
0
 
LVL 5

Author Comment

by:j_powers
ID: 6460509
yes, for now.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6460537
I fooled with it for most of yesterday afternoon to no avail.

**********************
I would like to get a macro that places the image and populates the ALT tag. As an added bonus have
the macro resize to 20x20 pixels and hyperlink to a webpage.
**********************

I'll try it again this afternoon, but I may not be able to get all of the "bonus section" done.  8-(

The problem is that a link is not an inherent aspect of the img tag, which the alt, height & width are.  Therefore, it cannot be populated in the same manner as we did for these elements.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6464838
Can't get it to link for the life of me.  Sorry.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6483383
j-powers...a week later & I still can't get it to link.  Would you like to #1 post a 0 point question in the Visual Basic ta asking for someone to come here and try and build on what I've already provided or #2 close the question?
0
 
LVL 3

Expert Comment

by:modder
ID: 6517091
j_powers hasn't logged in since 14 September. Maybe he's on vacation.
0
 
LVL 7

Expert Comment

by:ClassyLinks
ID: 6517129
Ok Modder...thanks.....leave it open for another week?
0
 
LVL 3

Expert Comment

by:modder
ID: 6517139
Yeah. That should be plenty.

j_powers - if you're reading this, just give a bit of feedback, will you please? Even if nobody gave you the help you were looking for, let me know and I'll be happy to assist in refunding your points.
0
 
LVL 7

Accepted Solution

by:
ClassyLinks earned 100 total points
ID: 6538891
Hi modder.....please close this q.  Thanks.
0
 
LVL 5

Author Comment

by:j_powers
ID: 6558475
Sorry I have moved on to other things. Completely forgot about the Q.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Nodejs not returning the response body as expected 4 170
Code Editors 10 223
Show/hide areas of web form 10 80
WEB Service vs ??? 7 132
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our systems…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question