P
Philip Thonning Skou
Hi,
I was hoping somebody could help me. I work for a botanic
garden and are trying to make our herbarium label process
easier. I have created a template of a label in Word and
am exporting data from our database into this word
template. I am having a problem with the macro I have
created to merge the data. It goes to the debugger every
time there is a double quote (") in the data.
a) Is " a reserved character in VB?
b) Is there a way around this problem. I think I need to
keep the " in the data because it is used in fields for
tree height measurements.
Here is the macro for the merge:
Sub merge_default()
'
' merge_default Macro
' Macro recorded 6/27/2003 by PTS
'
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
End Sub
c) The Word template stays open when a merge is
successful. How do I close the word template so it is
only the merged document that stays open?
Thank you in advance!
I was hoping somebody could help me. I work for a botanic
garden and are trying to make our herbarium label process
easier. I have created a template of a label in Word and
am exporting data from our database into this word
template. I am having a problem with the macro I have
created to merge the data. It goes to the debugger every
time there is a double quote (") in the data.
a) Is " a reserved character in VB?
b) Is there a way around this problem. I think I need to
keep the " in the data because it is used in fields for
tree height measurements.
Here is the macro for the merge:
Sub merge_default()
'
' merge_default Macro
' Macro recorded 6/27/2003 by PTS
'
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
End Sub
c) The Word template stays open when a merge is
successful. How do I close the word template so it is
only the merged document that stays open?
Thank you in advance!