PDA

View Full Version : [VBA] Sostituire .lnk in file word


Cecilia76
08-01-2007, 10:32
Ragazzi,

salve a tutti. Ho un problema e volevo sapere se qualcuno puņ aiutarmi.
Dunque: ho un centinaio di file word in cui sono presenti (come oggetti embedded suppongo) dei file .lnk di windows.
Ora, dovrei sostituire i file .lnk perchč puntano a file sbagliati e lo vorrei fare in modo automatico (o quasi).
E' possibile farlo con delle macro o con VBA?
Qualcuno puņ instradarmi?

Grazie, Cec.

Cecilia76
09-01-2007, 10:49
Ragazzi,

nessuno sa aiutarmi? Io ho scoperto che quando si trascinano dei file .lnk in word si creano delle InlineShape. Allora ho provato a enumerare le InlineShapes presenti in un documento e funziona, ma non riesco ad avere nessuna info (ad esempio il nome del file.lnk).
Ecco il codice:


Sub EnumInlineShapes()
Dim i As Long, tmp As InlineShape
For i = ActiveDocument.InlineShapes.Count To 1 Step -1
With ActiveDocument.InlineShapes(i)
If .Type = wdInlineShapeEmbeddedOLEObject Then
MsgBox "Embed OLE Object"
'qui vorrei prendere il nome del file
Else
MsgBox "Other"
End If
End With
Next i
End Sub



Qualche suggerimento??

C.