Posts by Triple S

    Re: info duplication in word


    If you insert a field as a Link and Reference "Ref" and have the source bookmarked all you have to do is put that bookmark name after REF and it will duplicate the info however you would need to call a macro that would update fields on exit of the bookmark or some other formfield etc. It's not hard and I can give you some very simple code to do it but see if anyone else has any suggestions first.

    Re: the saving name in Word


    Ok try this, It's been a while since I've used this so it might not work but if it does I've just saved you a lot of heartache as macro's in word are a bitch.


    First in the document assign a bookmark to the formfield or whatever you used for where the recipient name is going to go. Call it "Namefile" and make sure you get the case of the letters correct or edit the code to match what you call it.
    Then in a module in the template enter the following code.
    Once that is done find a way to call the macro into running it on exit of a certain formfield or even at the end of your macro that has the input boxes for the details.


    If this isn't clear Let me know and I'll see if I can help more.

    Re: Look Up or Index


    Just make sure in the source Data workbook that the codes that are on the far left side (the ones that correspond to the ones you enter to be given a name) are sorted in Ascending order or vlookup won't work properly.
    Also if you still don't understand why that formula works, try going to insert then function and find the vlookup function when it gets to the stage where you tell it where to look for stuff check out the explanation's they might help you to understand.

    Re: Word VBA - if function and form fields.


    Anyone? I suspect for someone who is decent with VBA they could past my code into a module then create the two text boxes and rename them to the bookmark names and would then very quickly be able to figure out the problem but I might be wrong.
    I just don't know enough about the protocols to figure this out.

    Re: Word VBA - if function and form fields.


    Ok dunno why cause it works for me.
    the error occurs highlighting the".value =" on the second line of code.
    error reads: "Compile Error.
    Meathod or or data member not found." but I know that bookmark exists.

    Re: Using formulas in word


    If you haven't had an answer on this yet I might be able to help, I have a document running at the moment which adds up the values within certain bookmarks, shouldn't be hard to figure out how to multiply etc. The catch is as far as I know the only way to do it is within VBA which is a bugger in word.
    Give me a reply so I don't waste any time on this and I'll wee what we can come up with.

    Hi all, I'm trying to use VBA for word to give an outcome based on a varying value in a form field. My problem is that I get an error every time I try to run the macro. I'm trying to use if/elseif functions but if there is a better way I'd be happy to use it,
    a sumple of my existing code is included below. Any help would be appreciated, I hate Word VBA it's so hard compaired to Excel.
    "Text86" is populated from a VBA calculation which outputs a sum total of several other fields so it should be recognisable as a number, I'm sure this isn't the problem.


    Public Sub MAIN()
    If ActiveDocument.Bookmarks("Text86") > 22 Then
    ActiveDocument.Bookmarks("Text94").Value = "Poor"
    ElseIf ActiveDocument.Bookmarks("Text86") > 36 Then
    ActiveDocument.Bookmarks("Text94") = "Average"
    ElseIf ActiveDocument.Bookmarks("Text86") > 48 Then
    ActiveDocument.Bookmarks("Text94") = "Good"
    ElseIf ActiveDocument.Bookmarks("Text86") > 56 Then
    ActiveDocument.Bookmarks("Text94") = "Very Good"
    End If


    End Sub


    Thanks


    Nathan