Information générale
Catégorie:
Codage, syntaxe et commandes
>But an Address property is Read-Only (at least that's what VFP says) :(
>Mark
Yes, that is right. but you going to have to go and delete first the link and
then create a new one instead with the required change. the address info will give you the string and then modify it, pos the cursor where the link is delete it and then create the new one in top of it.. but that is the part that I am still confuse....kind of what I did here
Dim x As Integer, xx As Integer, xxx As Integer, i As Integer
Dim tempadd As String, newadd As String
x = ActiveDocument.Hyperlinks.Count <-- will give you the total links in
the document
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.TypeParagraph
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeText Text:="nuber of links are " + Str(x)
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeParagraph
Selection.MoveUp Unit:=wdLine, Count:=1
' Loop to replace the links..
For i = 1 To x
tempadd = ActiveDocument.Hyperlinks(i).Address
tempadd = tempadd + Trim(Str(i))
newadd = Selection.Hyperlinks(i).Address
'ActiveDocument.Hyperlink.Address = tempadd
Selection.Range.Hyperlinks(1).Delete <--- delete link
' Now create a new one instead... Kind of...
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"d:\My Documents\Job Description.doc", SubAddress:=""
some more code ...
Selection.TypeParagraph
Selection.TypeText Text:=tempadd
see if you can better this code...
but I think the basic principle is here..
sorry If I can help you more
Mark Oliva
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement