Finding Tags inside of VBA coding.

jexline

New Member
Joined
Oct 19, 2009
Messages
7
I am trying to use a variable which will take the (string) value of a cell and update the "tags" on a SaveAs routine.

I have been looking everywhere for a way to reference the "tags" field, under file, save as, but I cannot find it any references to it. I must be calling the field by the wrong name because all my searches are coming up with other things.

I think it may be a part of the workbook properties but have not located it there either.

If anyone knows what the field is called and how I can reference it (with VBA code) I would really appreciate it!

Thanks,

John
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Thanks for your quick response. I am in Excel 2007. When I click the office button, then select "Save As" and Excel workbook, a window pops up (where to save the file). In the lower right corner of that window there is a field named "Tags:" and has "add a tag" in blue. When you click on add a tag, the field opens and you can type searchable tags.

That is the field that I would like to populate, with a variable.

Sorry I don't know how to drop a screen print in here.
 
Upvote 0
Hi jexline
Welcome to the board

Try:

Code:
ActiveWorkbook.Keywords = "MyTag1"

for more than one, use semicolons as separator

Code:
ActiveWorkbook.Keywords = "MyTag1;MyTag2"
 
Upvote 0
Thanks PGC. I will try this. If I was going to stuff the contents of MyTag1 with the contents of a variable (say mTag1), how would the argument look?

Set ActiveWorkbook.Keywords = "MyTag1" as mTag1
 
Upvote 0
If you have a string variable mTag1, use

Code:
ActiveWorkbook.Keywords = mTag1
 
Upvote 0
I have since found the Document Information Panel and have gotten the following script to work. (now I just can't get Category or Status to reference, but I should be good to go. Thanks for the help!

ActiveWorkbook.Author = "John Exline"
ActiveWorkbook.Title = "Key Collection Table"
ActiveWorkbook.Subject = "Accounts Receivable"
ActiveWorkbook.Keywords = "AR;Collections;Calls"
ActiveWorkbook.Comments = "This is totally a test"
 
Upvote 0
now I just can't get Category or Status to reference

They are in the BuiltinDocumentProperties with the rest.

Try:

Code:
With ActiveWorkbook.BuiltinDocumentProperties
    .Item("Author") = "John Exline"
    .Item("Title") = "Key Collection Table"
    .Item("Subject") = "Accounts Receivable"
    .Item("Keywords") = "AR;Collections;Calls"
    .Item("Category") = "Some Category"
    .Item("Content Status") = "Some Status"
    .Item("Comments") = "This is totally a test"
End With
 
Upvote 0

Forum statistics

Threads
1,215,655
Messages
6,126,050
Members
449,283
Latest member
GeisonGDC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top