Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

use a function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew - 18 Nov 2004 05:42 GMT
Hi,

How can I use a function created in Macros on a Word document? for example:
I insert a mail merge field, which is a number, and this field will be an
input argument of the function:
1234 will input to the function
function changeItToMyNeed(insertfield)
'...my code here
End function

Thanks for any help.

Andrew
Andrew - 18 Nov 2004 07:07 GMT
Hi Andrew,

Your syntax for calling the function looks good.  Do you want to know how to
assign 1234 to a variable so that you can call your function?  Try selecting
the value and using the following code

Sub CallFunction()

Dim FieldValue As Integer

FieldValue = Selection
   MsgBox (changeItToMyNeed(FieldValue))
End Sub

> Hi,
>
[quoted text clipped - 9 lines]
>
> Andrew
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.