M
Marco
i'am now using the code below to insert images one by one in my word
document change width, height and add a border
But i want to make a form where i can select al pictures in one folder
and select which one of them should be used and formatted by the code
below.
First problem is how to use "With Dialogs(wdDialogInsertPicture).Show"
and store the path to the selected file in a variable?
Second is it possible to show a preview image of all the files from
that folder.
I'am working with word 2000
Sub Linktopicture()
With Dialogs(wdDialogInsertPicture)
.Show
End With
Dim mypicw As InlineShape
For Each mypicw In ActiveDocument.InlineShapes
mypicw.Select
X = mypicw.Width
If X > 302 Then
mypicw.Width = 302
End If
Next
Dim mypich As InlineShape
For Each mypich In ActiveDocument.InlineShapes
mypich.Select
Y = mypich.Height
If Y > 227 Then
mypich.Height = 227
End If
Next
With Selection.InlineShapes(0)
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
.Color = wdColorAutomatic
End With
.Borders.Shadow = False
'Selection.Collapse
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.TypeParagraph
End With
End Sub
--
document change width, height and add a border
But i want to make a form where i can select al pictures in one folder
and select which one of them should be used and formatted by the code
below.
First problem is how to use "With Dialogs(wdDialogInsertPicture).Show"
and store the path to the selected file in a variable?
Second is it possible to show a preview image of all the files from
that folder.
I'am working with word 2000
Sub Linktopicture()
With Dialogs(wdDialogInsertPicture)
.Show
End With
Dim mypicw As InlineShape
For Each mypicw In ActiveDocument.InlineShapes
mypicw.Select
X = mypicw.Width
If X > 302 Then
mypicw.Width = 302
End If
Next
Dim mypich As InlineShape
For Each mypich In ActiveDocument.InlineShapes
mypich.Select
Y = mypich.Height
If Y > 227 Then
mypich.Height = 227
End If
Next
With Selection.InlineShapes(0)
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth025pt
.Color = wdColorAutomatic
End With
.Borders.Shadow = False
'Selection.Collapse
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.TypeParagraph
End With
End Sub
--