Need code for enter key

C

Curt

With ActiveDocument
.Separator = wdSeparatorTab
End With
With above got delimiter window to come up as tab instead of blank. Now I
need to be able to insert a code for enter or mouse click to go past window.
This will then allow macro to proceed.
Many thanks to all
 
G

Gordon Bentley-Mix

Curt,

You haven't provided enough information to get a meaningful answer. The
Separator property isn't a valid property for the ActiveDocument object; it
can only be used with the CaptionLabel, Endnotes, Footnotes and
TableOfAuthorities objects. Obviously you've omitted some of your code.
Please post enough so that your purpose becomes more apparent.

(I suspect that what you are trying to achieve can be done by setting a
property for a particular Dialogs object, but since there are 3 to choose
from that use the Separator property...)
--
Cheers!
Gordon

Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.
 
C

Curt

End With
With ActiveDocument
.Separator = wdSeparatorTab
.Key = Enter
End With
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade\ZZZ.txt", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="",
SQLStatement1 _
Hope this is enough to explain. Have a text file that I am useing for mail
merge. Want to do merge via a macro. Recorded macro it stops on delimiter
screen. Asking for field seperator. That was comeing up blank and you had to
select seperator. The seperator tab put the tab in the selection box. So If I
can trigger responce to this in selection box it will go on to merge issue.
Getting some weird errors in merge. Records have to few fields? All records
have same nbr fields. Click on error then goes on to do merge. Haven't tried
to solve this one yet one step at a time. First time at a issue like this.
Thanks
 
C

Cindy M.

Hi Curt,

Does this text file have only the one record (plus the field headings)?

If yes, then the display of the dialog box is a known issue. Copying and pasting
the line with the headings (duplicating that line) often fixes the problem
(suppresses display of the dialog box).
End With
With ActiveDocument
.Separator = wdSeparatorTab
.Key = Enter
End With
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade\ZZZ.txt", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="",
SQLStatement1 _
Hope this is enough to explain. Have a text file that I am useing for mail
merge. Want to do merge via a macro. Recorded macro it stops on delimiter
screen. Asking for field seperator. That was comeing up blank and you had to
select seperator. The seperator tab put the tab in the selection box. So If I
can trigger responce to this in selection box it will go on to merge issue.
Getting some weird errors in merge. Records have to few fields? All records
have same nbr fields. Click on error then goes on to do merge. Haven't tried
to solve this one yet one step at a time. First time at a issue like this.
Thanks

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
C

Curt

Thanks for your responce. You are dealing with a novice.
The text file is built from a excel sheet it has many rows of data. I did
this to speed up mail merge. If I try to merge from excel it takes to long as
it will search entire sheet. I have column headings then rows of data. Text
file looks ok. Will supply copy if wanted. do not understand record 2 has to
few fields. Then click mouse and it goes on and merges.
Will enclose code that builds text file. Maybe you can give me an idea as to
how to repeat lines as you suggest.
Again Thanks

Open "C:\Parade\ZZZ.txt" For Output As #FF
For RowCount = 1 To Cells(Rows.Count, "A").End(xlUp).row
If WorksheetFunction.CountBlank(range("a" & RowCount & ":f" &
RowCount)) = 0 Then
If RowCount > 1 Then TotalFile = TotalFile & vbCrLf
For ColCount = 1 To Cells(RowCount, Columns.Count).End(xlToLeft).Column
If ColCount > 1 Then TotalFile = TotalFile & Chr(9)
TotalFile = TotalFile & Cells(RowCount, ColCount).Value
Next
End If
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top