View Single Post
 
Old 09-24-2017, 08:12 PM
russkris russkris is offline Windows 8 Office 2016
Novice
 
Join Date: Sep 2017
Location: Hobart, Tasmania, Australia
Posts: 3
russkris is on a distinguished road
Default

Hi macropod,
Thank you for taking the time to reply..

As i said, i totally googled and pieced together, something.. lol. but no I am not using a userform.

This is what I added(after much more googling.)

Code:
Dim subj1 As String
    Dim subj2 As String
    Dim subj3 As String
    Dim oTbl As Table
    Dim oRg As Range
    Set oTbl = ActiveDocument.Tables(1) ' first table in document
    
    Set oRg = oTbl.Cell(Row:=4, Column:=2).Range ' first part of subject
    oRg.MoveEnd Unit:=wdCharacter, Count:=-1 ' exclude the marker
    subj1 = oRg.Text
    
    Set oRg = oTbl.Cell(Row:=2, Column:=2).Range ' second part of subject
    oRg.MoveEnd Unit:=wdCharacter, Count:=-1 ' exclude the marker
    subj2 = oRg.Text
    
    Set oRg = oTbl.Cell(Row:=5, Column:=2).Range ' thrid part of subject
    oRg.MoveEnd Unit:=wdCharacter, Count:=-1 ' exclude the marker
    subj3 = oRg.Text

    .Subject = subj1 & " - " & subj2 & " - " & subj3
Which seems to work... ok.. However, as they are content controls, if the user doesn't enter a value the standard text of "Click here to enter text" goes into the subject line.
Reply With Quote