i want to write a vba macro that read the bookmark name on a selected place in word document.
I am not sure what you want to do but here goes.
If what you want to do is look through your current selection to see if it contains a bookmark you could try something like this:
Public Sub test() Dim i As Integer For i = 1 To ActiveDocument.Bookmarks.Count If ActiveDocument.Bookmarks(i).Start >= Selection.Start And ActiveDocument.Bookmarks(i).End <= Selection.End Then 'this bookmark is FULLY contained in the selection Debug.Print ActiveDocument.Bookmarks(i).Name ElseIf ActiveDocument.Bookmarks(i).Start >= Selection.Start And ActiveDocument.Bookmarks(i).End > Selection.End Then 'this bookmark starts in the selection but finishes after the selection Debug.Print ActiveDocument.Bookmarks(i).Name ElseIf ActiveDocument.Bookmarks(i).Start < Selection.Start And ActiveDocument.Bookmarks(i).End <= Selection.End Then 'this bookmark starts before the selection but finishes in the selection Debug.Print ActiveDocument.Bookmarks(i).Name Else 'this bookmark is totally OUTSIDE the selection End If Next End Sub
Now that you, and I 'cause I just found this, know how to use the .Start and .End you can also use this for any number of things.
However, if you want to do something else then please correct my understanding.
its working very good
it save me a time for this weekend
write a C++ program which take inputs from the user/keyboard and calculate his ZAKAT.
get the input from user may include
-Amount invested in business
-Amount given to other business partners as loan
-Amount payable to others
I made a prime number finder, it finds the nearest prime that is above and below any integer (Does not work that well with giant numbers.)
Made this in cpp.sh
Why would I need the x=y+1-1;?
x=y; just doesnt seem to work
Why is this?
And I know my coding ...
there are five tables (personTb, addressTb,churchTb) each holds data pertinent to an individual; (personAddress,personChurch) each hold the primary key for the person table and corresponding table IE personAddress holds primary key for addressTb.
both snippets work, my question is; Is my join correctly formatted?
select concat(personTb.p_fName,' ',personTb.p_mName,'. ',personTb.p_lName) ...