A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Cannot get field values



 
 
Thread Tools Display Modes
  #1  
Old November 18th, 2005, 11:00 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
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  
Old November 18th, 2005, 11:24 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
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  
Old November 19th, 2005, 05:50 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
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  
Old November 19th, 2005, 05:53 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
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  
Old November 19th, 2005, 07:57 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
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  
Old November 21st, 2005, 02:27 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Cannot get field values

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

  #7  
Old November 21st, 2005, 06:37 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
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.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Record Update Michelle Using Forms 5 October 28th, 2004 07:59 AM
Autonumber Ally H. General Discussion 7 August 27th, 2004 04:51 PM
Multiple Values in a Field Rush General Discussion 4 July 9th, 2004 07:43 PM
NUMBERING the pages Bob New Users 7 June 14th, 2004 12:20 AM
Supress blank lines in DOCPROPERTY field Mary Formatting Long Documents 10 May 25th, 2004 07:27 PM


All times are GMT +1. The time now is 06:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.