PDA

View Full Version : Having a Word macro pass commands to an add-in's macro application window?



ndb
03-02-2011, 06:00 PM
I have a Macro which automatically finds a reference number in my document, then opens an add-in's window (Endnote's CWYW addin) by a keyboard shortcut. The Endnote window that comes up has what I need in it, I don't need to enter anything other than clicking the Insert button. The problem is I don't see how I am able to automate the actual insertion, since Word won't record any kind of commands to the macro's application window (the Macro recorder doesn't see any typing or clicking, and doesn't seem to take the typed commands I tried).

I thought I could see what command is passed when "Insert" is clicked in the macro application window, but the EndNote Cwyw TemplateProject is closed from viewing. Suggestions please?

This is what I have so far:

Sub AppxRefGen()
'
' AppxRefGen Macro
'
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "#??"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Application.Run MacroName:="TemplateProject.NewMacros.ENFindCitations"
:dunnoHERE I JUST NEED ENFindCitation TO HAVE 'ENTER' KEY ACCEPTED OR THE 'INSERT' BUTTON CLICKED:think:

End Sub