Is it possible to remove built-in custom word properties? - vba

Is it possible to remove the built-in custom properties in word such as "checked by", "date completed" etc?
I want to create my own custom properties to fill in fields in the word document but I don't want to have to filter through the built-in custom properties to find the fields I want to fill in as is it likely some will be missed so therefore are looking for a way to remove these.
The delete button is greyed out so I'm guessing if this is an option then it will probably have to be done programmatically?
Thanks

You can delete custom document properties in the following way:
ActiveDocument.CustomDocumentProperties("CustomNumber").Delete
or if you need to remove all of them:
For Each prop In ActiveDocument.CustomDocumentProperties
prop.Delete()
Next

Related

Hide few fields in EditForm.asx of Picture Library in sharepoint 2010

I have a picture library and added few fields to it. When i click add new item from picture library, the EditForm.aspx appears after uploading the picture. This form contains many fields of which I want to hide Title, Date Picture Taken, Description, and Keyword. In short the EditForm should contain only Name, Preview and the columns that I have added. Is it possible to hide the other columns? I want to perform this out of the box.
Several possibilities.
You can use SharePoint Designer to manipulate the NewForm, EditForm and DisplayForm. Edit the existing form, use CSS to set the out of the box HTML form to hidden, then add a new custom form to the page and remove the columns you don't want to see.
If you don't want to use these columns at all, just delete them in the Library settings
If you don't want to delete the columns, click the parent content type in the Library settings, then edit each column and set it to "hidden"
Check this out: http://sarangasl.blogspot.in/2009/10/hide-column-in-edit-new-or-display-mode.html
I found this solution to be really simple and effective. Very well documented and descriptive.

Removing item level mouseover effect in SharePoint 2010

I am trying to remove the hover effect that brings up the checkbox next to the row item in SharePoint 2010 list item rows. Is there any settings that can make this happen? I would like to keep away from having to tinker with the CSS and javascripts. Please see illustration below. Thank you.
There are no settings for that sort of thing - the selection check box is a default behavior. You are going to have to modify the CSS, for that.
Use SharePoint Designer (Available Here]1) to help determine whitch CSS elements control that behavior, and make a custom style sheet to override it.
You can accomplish this by going to the Modify View option of your list and unchecking the Allow Individual Item Checkboxes under Tabular View options.
Note: If you are using a Web Part to view it you might have to set the view again for the changes to reflect.

Can I change the list style used when Word (2007) auto-creates a bulleted list?

I have a template where I've created a custom list style, and ensured that that list style is used when the user clicks on the "bullet" icon on the ribbon (by overriding FormatBulletDefault).
However, if the user types:
* foo
...then Word will automatically turn that into a bulleted list using the "wrong" (default) list style, which is not the one I want to use. This will mean that users end up with wrongly-formatted lists.
If I could turn off the "automatically create bulleted lists" setting for my template, then I might consider that, but it's an application setting, and I don't want to turn it off for all documents.
Is there any way to intercept the auto-creation of a bulleted list? Or to change the list style it uses?
I do not know of any way to intercept this behavior as it is being caused by Word's AutoCorrect AutoFormat As You Type functionality. However you can turn off the Apply as you type|Automatic bulleted lists behavior temporarily. To do so, add the following code to Private Sub Document_Open():
ActiveDocument.Application.Options.AutoFormatAsYouTypeApplyBulletedLists = False
This will turn off this functionality for Word globally (and as such will affect concurrently opened documents), but if you include the reverse in Private Sub Document_Close():
ActiveDocument.Application.Options.AutoFormatAsYouTypeApplyBulletedLists = True
the setting will be restored. You can find the Word object model mappings for the AutoFormat As You Type functionality here:
http://technet.microsoft.com/en-us/library/Ee692775.big_asyoutype(en-us,TechNet.10).jpg
and an article explaining the VBA implementation of these settings here:
http://technet.microsoft.com/en-us/library/ee692775.aspx

Setting Lotus Notes section border using VBA

Friends,
I'm using VBA to create Lotus emails populated from an Excel spreadsheet, and I'm stuck on a really silly point.
When I create a new section in the note, business rules require me to give it a border. They've been doing this manually for years and are used to doing this from the Notes UI. They create a new section, then go to its properties and then change it to have a border (please see the border and style part in the properties window in this screenshot).
I can't figure out how to add this border through VBA. Any ideas? I've tried changing the TitleStyle, but that only affects things like fonts and color. I have everything else done, just stuck on the border!
Thanks!
Mike
The NotesRichTextSection class doesn't give you any way to change the border, unfortunately. Rich text items in Lotus Notes aren't supported very well via the API, so often you'll find a mismatch between what you can do on the client vs. what you can do in code.
There might be a workaround if you're up for trying it. First you need to create a simple form in Notes that has a rich text field, let's call it Body, surrounded by a section. Setup the section to appear however you want, with the border set, etc. You'll also need another hidden text field, called Title, and you'll set the section's title to be computed based on that Title field.
Then in your VBA code you're going to create a new NotesDocument based on that form. You'll set the Title field, and you'll add content into the Body rich-text item. Then you'll need to call the ComputeWithForm method followed by the Save method. Finally, you can use the RenderToRTItem method on the document to put the entire document into your original note's rich text field. Make sense?
No guarantees that will work from VBA, but I've done similar things in the past using LotusScript and it did the trick.
You could just set the borders of the cells you are copying using the Borders() property.
Example:
Range("B2:C4").Borders.LineStyle = xlDash
Range("B2:C4").Borders(xlEdgeBottom) = RGB(255,0,0)

How do I check programmatically if any document properties of a MS Word 2007 document has changed?

For example, I want the Title fields in the body and the page headers of the document to be updated automatically whenever the Title field in the document properties panel is changed. I know how to update the fields, but I want to know the name of the event that will tell me when the document properties have changed.
Your help will be appreciated. Thanks.
I also asked it on the MSDN Forums.
You can certainly check for these kinds of things in some of the events, such as DocumentBeforeClose or WindowSelectionChange, but this may be overkill. Instead, you could just use fields - they will update automatically. For example, go to Insert and then click on Quick Parts and then Field... Go to the Document Information section in the dropdown on the left and choose Title. Then, insert that and go back to the Home tab on the Ribbon and set its style to Title.
You also mention you also want page headers - are those properties you're setting in the Document Panel?
Word doesn't have any events like that. The best you might be able to do is use the selection change event, which will happen fairly often, but then you have to check all the propertiers of all the documents.
I think you're trying to do something that Word doesn't normally do. There are certain times when fields are updated and that's it. Teach you users how it works.