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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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? |
Thread Tools | |
Display Modes | |
|
|