Copy+paste macro

C

Caspar M Lund

Hi!

I have a macro (see below) that runs the file->send to ->
person in distribution list with spesific parameters. What
I want is that a spesific text in that word-doc to
overwrite the "Distribution: Document" in the .Subject
= "Distribution: Document" line in the makro.

Is this possible?

Best regards
Caspar M Lund
Norway




Sub distr()
'
' distr Makro
' Makro registrert 01.04.2004 av caspar
'

ActiveDocument.HasRoutingSlip = False
ActiveDocument.HasRoutingSlip = True
ActiveDocument.RoutingSlip.AddRecipient
Recipient:="Arne Kjetil Johnsen"
ActiveDocument.RoutingSlip.AddRecipient
Recipient:="Nils Ivar Stellberg"
With ActiveDocument
With .RoutingSlip
.Protect = wdAllowOnlyComments
.Subject = "Distribution: Document"
.Message = ""
.Delivery = wdOneAfterAnother
.ReturnWhenDone = True
.TrackStatus = True
End With
.Route
End With
End Sub
 
P

Peter Hewett

Hi Caspar M Lund

You don't say what text in your document you want to use. So here's how to use
the currently selected text as the subject line. Replace:

.Subject = "Distribution: Document"
with:
.Subject = Selection.Text

HTH + Cheers - Peter
 
P

Peter Hewett

Hi Caspar M Lund

It would have helped if you'd said so in the first place:

Selection.HomeKey wdStory
Selection.MoveDown wdLine, 2, wdExtend

HTH + Cheers - Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top