![]() |
#1
|
|||
|
|||
![]()
In the past, I have added selected text to bookmarks programmatically with VBA as indicated in Sub Macro11(). Works great.
My first try with Custom Document Properties! I would like to add selected text from a word document to DocProperty Programmatically with VBA. Not sure if this is possible, maybe my syntax needs work? Any Help. Code:
Sub Macro11() With ActiveDocument.Bookmarks .Add Range:=Selection.Range, Name:="test1bm" .DefaultSorting = wdSortByName .ShowHidden = False End With End Sub Code:
Sub Macro13() With ActiveDocument .Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "DOCPROPERTY FirstTest1Custom ", PreserveFormatting:=True End With End Sub |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Sandy27 | Word | 9 | 01-03-2014 01:51 PM |
![]() |
SuzeG | Word VBA | 4 | 12-17-2013 03:40 PM |
Using DocProperty Field Codes multiple times in the same document | trueimage | Word | 2 | 09-18-2013 04:44 PM |
Field DOCPROPERTY LastSavedTime format problem | ragesz | Word | 4 | 10-29-2012 06:58 AM |
My plain text post got converted to rich text in a reply, how to convert it back? | david.karr | Outlook | 0 | 01-05-2012 09:46 AM |