-----Original Message-----
1. That was very helpful. Thank you.
2. Do you know where can I find a list of all the
arguments for the Selection object, with explanations for
them, i.e., how they work, what they require, etc.? I've
tried to find it in the VBA help file, and on Microsoft's
website, but I haven't been able to find it.
3. I'm hoping that by learning the Selection arguments,
I'll be able to figure out how to copy the fullname into
the Windows clipboard...without pasting it onto a
document. (My subsequent challenge to myself will be to
delete [from any such text] the outline number and the tab
or spacess following the number, and thereafter to paste
the text as unformatted text into a document. I'm not
asking you to do this work for me, I just couldn't help
sharing where I'm going with this, in case you find it
interesting to see how a newbie plans to grow in vba
programming.)
Thanks again,
marc
-----Original Message-----
Hi Marc
Your code is probably not working because you need a
reference set to the Microsoft Forms Object Library.
(To add this, click on "Tools>References" in your VBA
editor)
Here is a bit of code where you won't have to set those
kind of references. It uses the Selection object to get
the data into the clipboard, opens a new doc, pastes the
name, prints it, then closes that doc.
---------------------
Sub Show_n_Print_FullNam()
Dim strFulNam As String
strFulNam = ActiveDocument.FullName
MsgBox strFulNam
Selection.Text = strFulNam
Selection.Cut
Documents.Add
Selection.Paste
ActiveDocument.PrintOut
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
End Sub
---------------------
Hope that helps,
Dennis
-----Original Message-----
I'm trying (vba) to copy the fullname to a msgbox, and
to
a variable (strFulNam) and to the Clipboard, and to
print
out the fullname.
My coding below doesn't work, except to show the
fullname in a msgbox.
Any help would be much appreciated.
Thanks,
Marc
Dim strFulNam As String
strFulNam = ActiveDocument.FullName
MsgBox ActiveDocument.FullName
Dim MyDataObj As New DataObject
MyDataObj.SetText strFulNam
MyDataObj.PutInClipboard
MyDataObj.GetFromClipboard
.
.
.