K
KLH
I'm trying to do something similar to redirecting output in DOS and shell
scripting, where you can use the output from one command as the input for
another command.
I'm trying to create a macro that will create a bookmark name by copying and
pasting a bit of text from the document. At one point in the macro there is
this command:
Selection.Copy
This copies the text that I want to use as a macro name. Later, there is
this section:
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="Bkmk1"
.DefaultSorting = wdSortByName
.ShowHidden = False
The problem is, every time I run the macro, it uses "Bkmk1" as the input for
the bookmark name. Is there a way to set the text copied in the first
command as a variable, and then use the value of that variable for the
bookmark name?
scripting, where you can use the output from one command as the input for
another command.
I'm trying to create a macro that will create a bookmark name by copying and
pasting a bit of text from the document. At one point in the macro there is
this command:
Selection.Copy
This copies the text that I want to use as a macro name. Later, there is
this section:
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="Bkmk1"
.DefaultSorting = wdSortByName
.ShowHidden = False
The problem is, every time I run the macro, it uses "Bkmk1" as the input for
the bookmark name. Is there a way to set the text copied in the first
command as a variable, and then use the value of that variable for the
bookmark name?