A
andreas
Dear Experts:
Is it possible to copy the file name of the active document into the
clipboard via VBA? Below macro performs this task BUT I would like the
macro to copy the file name into the clipboard WITHOUT first creating
a new document and copy the string from there.
Hope this is feasible. Help is much appreciated. Thank you very much
in advance. Regards, Andreas
Sub CopyActiveDocumentNameToClipboard()
Dim strName As String
strName = ActiveDocument.Name
Dim newDoc As Document
MsgBox ("this document's name is " & strName)
Set newDoc = Documents.Add
newDoc.Range.Text = strName
Selection.WholeStory
Selection.Copy
Selection.Collapse direction:=wdCollapseStart
Is it possible to copy the file name of the active document into the
clipboard via VBA? Below macro performs this task BUT I would like the
macro to copy the file name into the clipboard WITHOUT first creating
a new document and copy the string from there.
Hope this is feasible. Help is much appreciated. Thank you very much
in advance. Regards, Andreas
Sub CopyActiveDocumentNameToClipboard()
Dim strName As String
strName = ActiveDocument.Name
Dim newDoc As Document
MsgBox ("this document's name is " & strName)
Set newDoc = Documents.Add
newDoc.Range.Text = strName
Selection.WholeStory
Selection.Copy
Selection.Collapse direction:=wdCollapseStart