How to create the brackets of the Field-Functions?

U

Uwe Suedbeck

I want to create e Field including a Picture in my Mailmerge, but when i try
to create the brackets Word uses to interprete the Functions, in my
Range-Object, Word does not Understand this bracket and draws a simple "{"
or "}" but doesn´t interpretes them.

How can i create this brackets in my vb-code??
 
D

Doug Robbins - Word MVP

The following examples are from the Visual Basic Help file

This example inserts a USERNAME field at the beginning of the selection.

Selection.Collapse Direction:=wdCollapseStart
Set myField = ActiveDocument.Fields.Add(Range:=Selection.Range, _
Type:=wdFieldUserName)

This example inserts a LISTNUM field at the end of the selection. The
starting switch is set to begin at 3.

Selection.Collapse Direction:=wdCollapseEnd
ActiveDocument.Fields.Add Range:=Selection.Range, _
Type:=wdFieldListNum, Text:="\s 3"

This example inserts a DATE field at the beginning of the selection and then
displays the result.

Selection.Collapse Direction:=wdCollapseStart
Set myField = ActiveDocument.Fields.Add(Range:=Selection.Range, _
Type:=wdFieldDate)
MsgBox myField.Result

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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