Get bookmark index using system.Information()Create bookmark via selected text?Get All Bookmarks from Word DocumentRewriting Bookmarks in Word Using VB.NETReplace Text in Bookmark in Word without Deleting BookmarkHow to delete a line above a bookmark in Word using vbaGet Word bookmark index to replace image inside bookmark from ExcelInsert text before bookmarkWord VBA - Returning the bookmark by finding TextGet text at the bookmarkVBA and Word: Cutting a TextBox name to match that of a Bookmark
What systems of robust steganography are out there?
What is this old "lemon-squeezer" shaped pan
Ethical for a company to ask employees to move furniture on the weekend?
Index Uniqueness Overhead
Extension of trace on von Neumann subalgebra
If a player tries to persuade somebody, what should that creature roll not to be persuaded?
I have accepted an internship offer. Should I inform companies I have applied to that have not gotten back to me yet?
Confusion about a proof of a limit formula
What made Windows ME so crash-prone?
Are the errors in this formulation of the simple linear regression model random variables?
Do aircraft cabins have suspension?
If I stood next to a piece of metal heated to a million degrees, but in a perfect vacuum, would I feel hot?
Why does FFmpeg choose 10+20+20 ms instead of an even 16 ms for 60 fps GIF images?
Remove cardinal direction letters
Did 007 exist before James Bond?
In Adventurers League, is there any way for an 5th-level wizard to gain heavy armor proficiency?
Was Willow's first magic display (blazing arrow through arm) actual magic, and if not, what's the trick?
Using two linked programs, output ordinal numbers up to n
Credit card stolen every 1-2 years. What am I doing wrong?
Will it hurt my career to work as a graphic designer in a startup for beauty and skin care?
What impact would a dragon the size of Asia have on the environment?
Draw a line nicely around notes
Cauchy reals and Dedekind reals satisfy "the same mathematical theorems"
What does it mean to fail a saving throw by 5 or more?
Get bookmark index using system.Information()
Create bookmark via selected text?Get All Bookmarks from Word DocumentRewriting Bookmarks in Word Using VB.NETReplace Text in Bookmark in Word without Deleting BookmarkHow to delete a line above a bookmark in Word using vbaGet Word bookmark index to replace image inside bookmark from ExcelInsert text before bookmarkWord VBA - Returning the bookmark by finding TextGet text at the bookmarkVBA and Word: Cutting a TextBox name to match that of a Bookmark
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm using below line to get a selected drop down from an endoresment.
ActiveDocument.FormFields(ActiveDocument.Range.Bookmarks(Selection.Information(30)).Name).Dropdown.Value
But I'm unable to get the correct bookmark index through Selection.Information(30)
hence getting incorrect bookmark name.
Can any one please help me here.
vba ms-word
add a comment |
I'm using below line to get a selected drop down from an endoresment.
ActiveDocument.FormFields(ActiveDocument.Range.Bookmarks(Selection.Information(30)).Name).Dropdown.Value
But I'm unable to get the correct bookmark index through Selection.Information(30)
hence getting incorrect bookmark name.
Can any one please help me here.
vba ms-word
Selection.information (30) gives the current bookmark index with that index I can get the bookmark name but unfortunatly i am not getting the current book mark index. Is there any way to get current bookmark index?
– bandarubharath7777 bharath
Mar 26 at 10:31
I was on a mobile device that last few days so couldn't research this in detail. I hope the information in the Answer helps...
– Cindy Meister
Mar 28 at 14:33
Hi cindy,,,It works but, I am using like Activedocument.formfields(selection.bookmarks(1).name).enable = False but after that statement we are unprotecting the activedocument then the disabled bookmark again becoming enable after unprotecting. Can you help me here
– bandarubharath7777 bharath
Apr 4 at 7:36
What works? The code I proposed in the Answer? If yes, please mark that as the "Answer" since the original question has been taken care of. Start a new question for a new topic, with full information on how to reproduce the behavior, including the type of protection involved. Stack Overflow is not a "forum" where an endless discussion is possible - it's a Question & Answer format.
– Cindy Meister
Apr 4 at 11:21
add a comment |
I'm using below line to get a selected drop down from an endoresment.
ActiveDocument.FormFields(ActiveDocument.Range.Bookmarks(Selection.Information(30)).Name).Dropdown.Value
But I'm unable to get the correct bookmark index through Selection.Information(30)
hence getting incorrect bookmark name.
Can any one please help me here.
vba ms-word
I'm using below line to get a selected drop down from an endoresment.
ActiveDocument.FormFields(ActiveDocument.Range.Bookmarks(Selection.Information(30)).Name).Dropdown.Value
But I'm unable to get the correct bookmark index through Selection.Information(30)
hence getting incorrect bookmark name.
Can any one please help me here.
vba ms-word
vba ms-word
edited Mar 28 at 14:33
Cindy Meister
17.3k10 gold badges25 silver badges38 bronze badges
17.3k10 gold badges25 silver badges38 bronze badges
asked Mar 26 at 7:31
bandarubharath7777 bharathbandarubharath7777 bharath
63 bronze badges
63 bronze badges
Selection.information (30) gives the current bookmark index with that index I can get the bookmark name but unfortunatly i am not getting the current book mark index. Is there any way to get current bookmark index?
– bandarubharath7777 bharath
Mar 26 at 10:31
I was on a mobile device that last few days so couldn't research this in detail. I hope the information in the Answer helps...
– Cindy Meister
Mar 28 at 14:33
Hi cindy,,,It works but, I am using like Activedocument.formfields(selection.bookmarks(1).name).enable = False but after that statement we are unprotecting the activedocument then the disabled bookmark again becoming enable after unprotecting. Can you help me here
– bandarubharath7777 bharath
Apr 4 at 7:36
What works? The code I proposed in the Answer? If yes, please mark that as the "Answer" since the original question has been taken care of. Start a new question for a new topic, with full information on how to reproduce the behavior, including the type of protection involved. Stack Overflow is not a "forum" where an endless discussion is possible - it's a Question & Answer format.
– Cindy Meister
Apr 4 at 11:21
add a comment |
Selection.information (30) gives the current bookmark index with that index I can get the bookmark name but unfortunatly i am not getting the current book mark index. Is there any way to get current bookmark index?
– bandarubharath7777 bharath
Mar 26 at 10:31
I was on a mobile device that last few days so couldn't research this in detail. I hope the information in the Answer helps...
– Cindy Meister
Mar 28 at 14:33
Hi cindy,,,It works but, I am using like Activedocument.formfields(selection.bookmarks(1).name).enable = False but after that statement we are unprotecting the activedocument then the disabled bookmark again becoming enable after unprotecting. Can you help me here
– bandarubharath7777 bharath
Apr 4 at 7:36
What works? The code I proposed in the Answer? If yes, please mark that as the "Answer" since the original question has been taken care of. Start a new question for a new topic, with full information on how to reproduce the behavior, including the type of protection involved. Stack Overflow is not a "forum" where an endless discussion is possible - it's a Question & Answer format.
– Cindy Meister
Apr 4 at 11:21
Selection.information (30) gives the current bookmark index with that index I can get the bookmark name but unfortunatly i am not getting the current book mark index. Is there any way to get current bookmark index?
– bandarubharath7777 bharath
Mar 26 at 10:31
Selection.information (30) gives the current bookmark index with that index I can get the bookmark name but unfortunatly i am not getting the current book mark index. Is there any way to get current bookmark index?
– bandarubharath7777 bharath
Mar 26 at 10:31
I was on a mobile device that last few days so couldn't research this in detail. I hope the information in the Answer helps...
– Cindy Meister
Mar 28 at 14:33
I was on a mobile device that last few days so couldn't research this in detail. I hope the information in the Answer helps...
– Cindy Meister
Mar 28 at 14:33
Hi cindy,,,It works but, I am using like Activedocument.formfields(selection.bookmarks(1).name).enable = False but after that statement we are unprotecting the activedocument then the disabled bookmark again becoming enable after unprotecting. Can you help me here
– bandarubharath7777 bharath
Apr 4 at 7:36
Hi cindy,,,It works but, I am using like Activedocument.formfields(selection.bookmarks(1).name).enable = False but after that statement we are unprotecting the activedocument then the disabled bookmark again becoming enable after unprotecting. Can you help me here
– bandarubharath7777 bharath
Apr 4 at 7:36
What works? The code I proposed in the Answer? If yes, please mark that as the "Answer" since the original question has been taken care of. Start a new question for a new topic, with full information on how to reproduce the behavior, including the type of protection involved. Stack Overflow is not a "forum" where an endless discussion is possible - it's a Question & Answer format.
– Cindy Meister
Apr 4 at 11:21
What works? The code I proposed in the Answer? If yes, please mark that as the "Answer" since the original question has been taken care of. Start a new question for a new topic, with full information on how to reproduce the behavior, including the type of protection involved. Stack Overflow is not a "forum" where an endless discussion is possible - it's a Question & Answer format.
– Cindy Meister
Apr 4 at 11:21
add a comment |
1 Answer
1
active
oldest
votes
The more "conventional" way to get the name of the currently active/selected bookmark name is:
Selection.Bookmarks(1).Name
Since this appears to be a form field, it's also possible to get the name via that collection:
Selection.Range.FormFields(1).Name
In a comment the request is for the bookmark index, although the request in the Question is for the bookmark name... In any case, to get the bookmark index get the count of all bookmarks from the start of the document to the end of the selection. (Note that this gets the index of the last previous bookmark, which is not necessary in the selection):
bkmIndex = ActiveDocument.Range(0, Selection.Range.End).Bookmarks.Count
Debug.Print ActiveDocument.Bookmarks(bkmIndex).Name
Please note that Information(30)
is an old Word Basic value (I had to look it up in 1995 literature) that has no official equivalent in the VBA object model. It still works for reasons of backwards compatibility, but in such cases there are no guarantees that it will continue to work.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351842%2fget-bookmark-index-using-system-information%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The more "conventional" way to get the name of the currently active/selected bookmark name is:
Selection.Bookmarks(1).Name
Since this appears to be a form field, it's also possible to get the name via that collection:
Selection.Range.FormFields(1).Name
In a comment the request is for the bookmark index, although the request in the Question is for the bookmark name... In any case, to get the bookmark index get the count of all bookmarks from the start of the document to the end of the selection. (Note that this gets the index of the last previous bookmark, which is not necessary in the selection):
bkmIndex = ActiveDocument.Range(0, Selection.Range.End).Bookmarks.Count
Debug.Print ActiveDocument.Bookmarks(bkmIndex).Name
Please note that Information(30)
is an old Word Basic value (I had to look it up in 1995 literature) that has no official equivalent in the VBA object model. It still works for reasons of backwards compatibility, but in such cases there are no guarantees that it will continue to work.
add a comment |
The more "conventional" way to get the name of the currently active/selected bookmark name is:
Selection.Bookmarks(1).Name
Since this appears to be a form field, it's also possible to get the name via that collection:
Selection.Range.FormFields(1).Name
In a comment the request is for the bookmark index, although the request in the Question is for the bookmark name... In any case, to get the bookmark index get the count of all bookmarks from the start of the document to the end of the selection. (Note that this gets the index of the last previous bookmark, which is not necessary in the selection):
bkmIndex = ActiveDocument.Range(0, Selection.Range.End).Bookmarks.Count
Debug.Print ActiveDocument.Bookmarks(bkmIndex).Name
Please note that Information(30)
is an old Word Basic value (I had to look it up in 1995 literature) that has no official equivalent in the VBA object model. It still works for reasons of backwards compatibility, but in such cases there are no guarantees that it will continue to work.
add a comment |
The more "conventional" way to get the name of the currently active/selected bookmark name is:
Selection.Bookmarks(1).Name
Since this appears to be a form field, it's also possible to get the name via that collection:
Selection.Range.FormFields(1).Name
In a comment the request is for the bookmark index, although the request in the Question is for the bookmark name... In any case, to get the bookmark index get the count of all bookmarks from the start of the document to the end of the selection. (Note that this gets the index of the last previous bookmark, which is not necessary in the selection):
bkmIndex = ActiveDocument.Range(0, Selection.Range.End).Bookmarks.Count
Debug.Print ActiveDocument.Bookmarks(bkmIndex).Name
Please note that Information(30)
is an old Word Basic value (I had to look it up in 1995 literature) that has no official equivalent in the VBA object model. It still works for reasons of backwards compatibility, but in such cases there are no guarantees that it will continue to work.
The more "conventional" way to get the name of the currently active/selected bookmark name is:
Selection.Bookmarks(1).Name
Since this appears to be a form field, it's also possible to get the name via that collection:
Selection.Range.FormFields(1).Name
In a comment the request is for the bookmark index, although the request in the Question is for the bookmark name... In any case, to get the bookmark index get the count of all bookmarks from the start of the document to the end of the selection. (Note that this gets the index of the last previous bookmark, which is not necessary in the selection):
bkmIndex = ActiveDocument.Range(0, Selection.Range.End).Bookmarks.Count
Debug.Print ActiveDocument.Bookmarks(bkmIndex).Name
Please note that Information(30)
is an old Word Basic value (I had to look it up in 1995 literature) that has no official equivalent in the VBA object model. It still works for reasons of backwards compatibility, but in such cases there are no guarantees that it will continue to work.
edited Mar 28 at 14:32
answered Mar 28 at 14:27
Cindy MeisterCindy Meister
17.3k10 gold badges25 silver badges38 bronze badges
17.3k10 gold badges25 silver badges38 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351842%2fget-bookmark-index-using-system-information%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Selection.information (30) gives the current bookmark index with that index I can get the bookmark name but unfortunatly i am not getting the current book mark index. Is there any way to get current bookmark index?
– bandarubharath7777 bharath
Mar 26 at 10:31
I was on a mobile device that last few days so couldn't research this in detail. I hope the information in the Answer helps...
– Cindy Meister
Mar 28 at 14:33
Hi cindy,,,It works but, I am using like Activedocument.formfields(selection.bookmarks(1).name).enable = False but after that statement we are unprotecting the activedocument then the disabled bookmark again becoming enable after unprotecting. Can you help me here
– bandarubharath7777 bharath
Apr 4 at 7:36
What works? The code I proposed in the Answer? If yes, please mark that as the "Answer" since the original question has been taken care of. Start a new question for a new topic, with full information on how to reproduce the behavior, including the type of protection involved. Stack Overflow is not a "forum" where an endless discussion is possible - it's a Question & Answer format.
– Cindy Meister
Apr 4 at 11:21