D
Dawn Bjork Buzbee
I'm working on a letter template in Word 2007 which allows users to
optionally add multiple elements to the letter and to print out different
versions (draft, memo, official, etc.).
Once optional element is a BCC entry which should not be printed on the memo
version if it was entered. Currently, the BCC entry includes a bookmark. To
remove it temporarily for printing, my code searches for the bookmark and
then cuts the text, prints the memo and then searches for the bookmark to
paste back the entry. I don't want to just undo because there may not be a
BCC entry.
I'm getting stuck on the code for the action if the bookmark is found. I've
tried IF FOUND THEN but that doesn't work. FYI, my code is below in case it
is helpful:
'Find bcc bookmark to select and cut bcc text; not used for memo but used
for other copies
Selection.GoTo What:=wdGoToBookmark, Name:="bcc"
If Found Then
Selection.MoveDown Unit:=wdLine, Count:=4, Extend:=wdExtend
Selection.Cut
End If
' Print out memo
ActiveDocument.PrintOut
'Find bcc bookmark to select and paste bcc text;
Selection.GoTo What:=wdGoToBookmark, Name:="bcc"
If Found Then
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End If
Thanks in advance,
optionally add multiple elements to the letter and to print out different
versions (draft, memo, official, etc.).
Once optional element is a BCC entry which should not be printed on the memo
version if it was entered. Currently, the BCC entry includes a bookmark. To
remove it temporarily for printing, my code searches for the bookmark and
then cuts the text, prints the memo and then searches for the bookmark to
paste back the entry. I don't want to just undo because there may not be a
BCC entry.
I'm getting stuck on the code for the action if the bookmark is found. I've
tried IF FOUND THEN but that doesn't work. FYI, my code is below in case it
is helpful:
'Find bcc bookmark to select and cut bcc text; not used for memo but used
for other copies
Selection.GoTo What:=wdGoToBookmark, Name:="bcc"
If Found Then
Selection.MoveDown Unit:=wdLine, Count:=4, Extend:=wdExtend
Selection.Cut
End If
' Print out memo
ActiveDocument.PrintOut
'Find bcc bookmark to select and paste bcc text;
Selection.GoTo What:=wdGoToBookmark, Name:="bcc"
If Found Then
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
End If
Thanks in advance,