Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a mergefield to a blank document via visual basic
Hello,
I am trying to write an add-in with visual studio 2008 (visual basic) for Word2007 to let users build a mailmerg document template. In the second steo these mergefields should handle values from an active directory. To do this I would like to have a ribbongroup with some buttons in it. By pressing a button a mail merge field e.g. {MERGEFIELD firstname} should be inserted at the current cursor position. I don't know how to use the Filed.Add method. Maybe someone has an example for me? |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a mergefield to a blank document via visual basic
Use:
ActiveDocument.Fields.Add Selection.Range, wdFieldEmpty, "Mergefield FirstName" -- 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, originally posted via msnews.microsoft.com "fledeboer" wrote in message ... Hello, I am trying to write an add-in with visual studio 2008 (visual basic) for Word2007 to let users build a mailmerg document template. In the second steo these mergefields should handle values from an active directory. To do this I would like to have a ribbongroup with some buttons in it. By pressing a button a mail merge field e.g. {MERGEFIELD firstname} should be inserted at the current cursor position. I don't know how to use the Filed.Add method. Maybe someone has an example for me? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word Visual Basic | Microsoft Word Help | |||
Visual Basic error 438 | Microsoft Word Help | |||
Activating a document that has visual basic text and form fields | Microsoft Word Help | |||
what is microsoft visual basic | New Users | |||
Visual Basic and VBA Forum | Mailmerge |