Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Crazy Macros
 
Posts: n/a
Default Cannot get field values

I have set up an Mail merge document. But, I have to manually click on
View Merge Data A Button to get values. I used the following macro
code to get execute mailmerge.

If ActiveDocument.MailMerge.State = wdMainAndDataSource Then
ActiveDocument.MailMerge.Execute
End If

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Cannot get field values

Maybe you need:

If ActiveDocument.MailMerge.State = wdMainAndDataSource Then
ActiveDocument.MailMerge.Destination = wdSendToNewDocument
ActiveDocument.MailMerge.Execute
End If

I am not sure where it goes if you don't specify a destination.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Crazy Macros" wrote in message
oups.com...
I have set up an Mail merge document. But, I have to manually click on
View Merge Data A Button to get values. I used the following macro
code to get execute mailmerge.

If ActiveDocument.MailMerge.State = wdMainAndDataSource Then
ActiveDocument.MailMerge.Execute
End If



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Crazy Macros
 
Posts: n/a
Default Cannot get field values

It doesn't work. Is there a way to debug. I can't even display MsgBox.

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Crazy Macros
 
Posts: n/a
Default Cannot get field values

Doug,

It doesn't work. Is there a way to debug this. I can't even use
MsgBox. Please advice.

  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Cannot get field values

I would suggest that you first get the merge working by executing it using
the user interface rather than jumping straight in with a macro.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Crazy Macros" wrote in message
oups.com...
Doug,

It doesn't work. Is there a way to debug this. I can't even use
MsgBox. Please advice.





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Crazy Macros
 
Posts: n/a
Default Cannot get field values

I got the merge working with UI. I need help to get it automated.

  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Cannot get field values

Can you get the msgbox function to work?

For example, if you run a macro with the command

msgbox "Hello World."

you should see a message box with that message in it.

You are going to have to sort that out before trying anything else.

Why do you want to automate the mailmerge? Are you trying to do it from
some other application?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Crazy Macros" wrote in message
oups.com...
I got the merge working with UI. I need help to get it automated.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
percentage values in a merge field ? Biff Mailmerge 1 November 16th 05 02:58 PM
Enter text in a field and have it appear as entered elsewhere Gregory Winters Microsoft Word Help 6 November 1st 05 02:09 AM
MS WORD - Linking a field in footer to a field in the document - Help SpaceApe Microsoft Word Help 4 September 22nd 05 06:19 AM
MS WORD - Linking a field in footer to a field in the document - Help [email protected] Microsoft Word Help 0 September 21st 05 12:16 PM
Text Form Field Ref in Footer Won't Update on Screen StarWine Microsoft Word Help 3 December 6th 04 06:17 PM


All times are GMT +1. The time now is 11:39 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"