G
Gerald Fay
I am using word macros along with Dragon Dictation to create documents. The
documents are patient encounters and each document starts with the
patient's name "George Smith".
Using a word macro at the end of the dictation, I use word to select the
name and then use the selection to name the document i.e. "George
Smith.doc". This works well unless the name is hyphenated i.e. "Mary
White-Jones". This is because the way I selected the text with the macro is
as follows:
Selection.HomeKey Unit:=wdStory
Selection.Extend
Selection.MoveRight Unit:=wdWord, Count:=2
The problem is that Word views a hyphen as a separate word in those
circumstances the Count is 4 not 2. (the hyphen counts as a word).
How can I use VBA to determine if there is a hyphen in the selected text and
if so extend the selection 2 more words?
Thanks
documents are patient encounters and each document starts with the
patient's name "George Smith".
Using a word macro at the end of the dictation, I use word to select the
name and then use the selection to name the document i.e. "George
Smith.doc". This works well unless the name is hyphenated i.e. "Mary
White-Jones". This is because the way I selected the text with the macro is
as follows:
Selection.HomeKey Unit:=wdStory
Selection.Extend
Selection.MoveRight Unit:=wdWord, Count:=2
The problem is that Word views a hyphen as a separate word in those
circumstances the Count is 4 not 2. (the hyphen counts as a word).
How can I use VBA to determine if there is a hyphen in the selected text and
if so extend the selection 2 more words?
Thanks