Hi i was wondering if someone could help me with my macro. I know this is more a Word VBA question but there involves an element of VBA in this. I currently have a macro whereby
a userform is called. I enter a number in the field on the user form and
click insert. This will then update the textfield in every page of my
document. Please see below what the macro is currently.
I want to somehow extend this macro to do the following
Dim Title As String
Dim frmTitle As UserForm1
Dim oStory As Range
Set frmTitle = New UserForm1
ActiveDocument.BuiltInDocumentProperties("Title").Value = .Title.Text
Set frmTitle = Nothing
For Each oStory In ActiveDocument.StoryRanges
If oStory.StoryType < wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
Set oStory = Nothing
I want to look into an excel file on the path G:\Forms\Index.xls
With the document that i have opened i want to set the documents name as a variable.
In my Index.xls, i have two columns, A and B. Column A will contain name of documents.
I want to therefore search Column A with the variable of the document i have opened.
Once found i want to offset this to column B, take the value as another variable and open a form page in the following way G:\Forms\ColumnBVariable.doc
When this is opened i want to insert the Title value from my current macro into the text field and then print off.
Would anybody know of how to possibly go about this.