T
tonyl
I've concocted the following macro. The idea is that the user prints
the current document onto headed paper but then if they want to email
it (as an attachment) and therefore want the logo on the document the
macro fetches the "pictures" from another document.
1) It feels "cludgy". Is there a more elegant way of achieving this
result?
2) I've tested it on Word 2002. It will be installed (tomorrow?) on
Word 2003 - should I expect it to work?
3) There are around 30 users on a network who need access to it. Is
it better installed locally or on the network? I assume Gobal
templates is where it should go?
4) How do I find out what the picture numbers are? So far I only know
by recording a macro and then seeing the result.
Many thanks.
Sub Letter2Email()
'
' Macro1 Macro
' Macro recorded 25/05/2006 by anthonyl
'
Dim docSource As Document
Dim docDest As Document
Set docDest = ActiveDocument
Set docSource = Documents.Open("L:\letterheadwithlogo.dot")
' Application.Move Left:=115, Top:=25
' ActiveDocument.Shapes("Picture 2").Select
docSource.Shapes("Picture 2").Select
Selection.Copy
docDest.Activate
Selection.Paste
Selection.ShapeRange.IncrementLeft -1
Selection.ShapeRange.IncrementTop -10
docSource.Activate
ActiveDocument.Shapes("Picture 3").Select
Selection.Copy
docDest.Activate
Selection.Paste
Selection.Collapse
docSource.Close wdDoNotSaveChanges
End Sub
the current document onto headed paper but then if they want to email
it (as an attachment) and therefore want the logo on the document the
macro fetches the "pictures" from another document.
1) It feels "cludgy". Is there a more elegant way of achieving this
result?
2) I've tested it on Word 2002. It will be installed (tomorrow?) on
Word 2003 - should I expect it to work?
3) There are around 30 users on a network who need access to it. Is
it better installed locally or on the network? I assume Gobal
templates is where it should go?
4) How do I find out what the picture numbers are? So far I only know
by recording a macro and then seeing the result.
Many thanks.
Sub Letter2Email()
'
' Macro1 Macro
' Macro recorded 25/05/2006 by anthonyl
'
Dim docSource As Document
Dim docDest As Document
Set docDest = ActiveDocument
Set docSource = Documents.Open("L:\letterheadwithlogo.dot")
' Application.Move Left:=115, Top:=25
' ActiveDocument.Shapes("Picture 2").Select
docSource.Shapes("Picture 2").Select
Selection.Copy
docDest.Activate
Selection.Paste
Selection.ShapeRange.IncrementLeft -1
Selection.ShapeRange.IncrementTop -10
docSource.Activate
ActiveDocument.Shapes("Picture 3").Select
Selection.Copy
docDest.Activate
Selection.Paste
Selection.Collapse
docSource.Close wdDoNotSaveChanges
End Sub