L
lizzzard59
Hi,
I'm relatively new to macros. I'm trying to create a macro that will
allow me to insert multiple photos into a new word document. By using
recorder, I was able to create something close to what I want, but it
uses the addpicture function(?) and only allows you to insert one
certain photo....I want to be able to add anywhere from 4 to 25 photos
at a shot, then be able to tab down to each caption (see below) and
fill in the blanks....
Sub test()
'
' test Macro
' Macro recorded 07/15/06 by Kevin Smith
'
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.InlineShapes.AddPicture FileName:= _
"C:\Documents and Settings\Owner\My Documents\My
Pictures\2004_02_15\100_0030.JPG" _
, LinkToFile:=False, SaveWithDocument:=True
Selection.TypeParagraph
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
Selection.TypeText Text:="Claim #:"
Selection.TypeParagraph
Selection.TypeBackspace
Selection.TypeText Text:=" "
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.TypeText Text:=Chr(11) & "Date taken:" & vbTab
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.TypeText Text:=" By: "
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.TypeText Text:=" Description: "
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.TypeParagraph
End Sub
Also on my wish list is the ability to change the size of each photo as
they are inserted so I don't have to do it manually. Any help you can
give would be greatly appreciated.
I'm relatively new to macros. I'm trying to create a macro that will
allow me to insert multiple photos into a new word document. By using
recorder, I was able to create something close to what I want, but it
uses the addpicture function(?) and only allows you to insert one
certain photo....I want to be able to add anywhere from 4 to 25 photos
at a shot, then be able to tab down to each caption (see below) and
fill in the blanks....
Sub test()
'
' test Macro
' Macro recorded 07/15/06 by Kevin Smith
'
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.InlineShapes.AddPicture FileName:= _
"C:\Documents and Settings\Owner\My Documents\My
Pictures\2004_02_15\100_0030.JPG" _
, LinkToFile:=False, SaveWithDocument:=True
Selection.TypeParagraph
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
Selection.TypeText Text:="Claim #:"
Selection.TypeParagraph
Selection.TypeBackspace
Selection.TypeText Text:=" "
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.TypeText Text:=Chr(11) & "Date taken:" & vbTab
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.TypeText Text:=" By: "
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.TypeText Text:=" Description: "
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
Selection.TypeParagraph
End Sub
Also on my wish list is the ability to change the size of each photo as
they are inserted so I don't have to do it manually. Any help you can
give would be greatly appreciated.