Obviously I'm doing something wrong! 
Author Message
 Obviously I'm doing something wrong!

Folks:

The main problem I am having here is with documents that have a hyperlink
object in the activedocument.hyperlinks, but no matching link showing when
alt-F9 is pressed.  Any idea why?  and how I can detect them? I am printing
a list of broken hyperlinks for people to fix, and they get annoyed when I
list 6 or so broken links that they cannot find in the document!

also, how can I discriminate between lack of permissions for a directory,
and the actual absence of the target document?
-------------------------------------
for each link in activedocument.hyperlinks
'
' stuff here to check for link = nothing
' why are there null link objects in here??????
'
    On Error Resume Next
    Result = 0
    dirResult = ""
    Result = GetAttr(link.address)
    dirResult = Dir(link.address)
    If Result = 0 And Len(dirResult) = 0 Then
     '
     ' stuff here for reporting a broken link
     '
    End If
next link
---------------------------------------



Wed, 01 Sep 2004 12:51:37 GMT  
 Obviously I'm doing something wrong!

I'd do something like a .range.select or even just print a report of
their lengths. You might find a bunch with under 3 chars - they'd be
good candidates for starters.

Use the Object Explorer (F2 in the VBE) to check out the properties of
the hyperlink object for more info. Help is also pretty good too, just
look under the properties list.


like this:

Quote:
>Folks:

>The main problem I am having here is with documents that have a hyperlink
>object in the activedocument.hyperlinks, but no matching link showing when
>alt-F9 is pressed.  Any idea why?  and how I can detect them? I am printing
>a list of broken hyperlinks for people to fix, and they get annoyed when I
>list 6 or so broken links that they cannot find in the document!

>also, how can I discriminate between lack of permissions for a directory,
>and the actual absence of the target document?
>-------------------------------------
>for each link in activedocument.hyperlinks
>'
>' stuff here to check for link = nothing
>' why are there null link objects in here??????
>'
>    On Error Resume Next
>    Result = 0
>    dirResult = ""
>    Result = GetAttr(link.address)
>    dirResult = Dir(link.address)
>    If Result = 0 And Len(dirResult) = 0 Then
>     '
>     ' stuff here for reporting a broken link
>     '
>    End If
>next link
>---------------------------------------

Steve Hudson, Word Heretic
HDK List MVP
Sydney, Australia

Please post replies/further questions to the newsgroup so that all may benefit.
If I don't provide enough information, please feel free to ask for more :-)


Sun, 17 Oct 2004 20:41:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I must be doing something wrong here

2. Am I doing something wrong ?

3. Am I doing something wrong...??

4. Am I doing something wrong...??

5. VB5's design interface using wrong font (or something odd)

6. Reading a Text File -- something's wrong

7. what i'm doing wrong?

8. What i'm doing wrong?

9. what I'm doing Wrong

10. Application Setup Wizard VB4 - I'm missing something, or I'm doing something silly.

11. ADO thinks DBMS is done, but DBMS ain't done

12. Outlook97, doing something Macro-ish?

 

 
Powered by phpBB® Forum Software