Microsoft Office Tutorials and References
In Depth Information
Changing the Path for Graphics Files
Select Case Selection.ShapeRange(1).RelativeVerticalPosition¶
'Positioned relative to the page¶
Case wdRelativeVerticalPositionPage,
If Left(sShapeName, 4) <> "Page" Then¶
sShapeName = "Page" & _¶
Selection.Information(wdActiveEndPageNumber) _¶
& "_" & sShapeName¶
End If¶
Case wdRelativeVerticalPositionLine, _¶
'It's formatted to move with the text and¶
'is therefore not linked with a specific page¶
Case Else¶
'unknown Enum constant¶
End Select¶
txtGrafikName.Text = sShapeName¶
End If¶
End Sub¶
' * * * * *¶
Sub ChangeGraphicName()¶
Selection.ShapeRange(1).Name = txtGrafikName.Text¶
End Sub¶
Function GetGraphicName() As String¶
If Selection.ShapeRange.Count > 0 Then¶
GetGraphicName = Selection.ShapeRange(1).Name¶
GetGraphicName = vbNullString¶
End If¶
End Function¶
Copy the standard module to a document, to a template, or to
Transfer the user form 'frmNameGraphic' to the same project, either by using
the Organizer or by dragging it in the Visual Basic Editor (VBE) to the
template's project.
To prepare a graphic so that the tool will recognize it:
1. First, format it with text wrapping (in the Layout tab of the Format
dialog box).
2. Then, position it relative to the page (click Advanced in the Layout tab
of the Format dialog box, choose the Picture Position tab, and deactivate
Move with the text).
Run the macro 'ShowGraphicName' and make sure the word "Page" plus the
page number on which the graphic should appear are at the beginning of the
graphic's name. Example: Page3 Picture of me
Search JabSto ::

Custom Search