T
todd m via OfficeKB.com
I know this sounds simple, but I just can't figure this out. I wish to
insert a first logo on the first page of my Word document (which I can do by
assigning my graphic as autotext and then inserting from the Insert>Autotext
toolbar), and then cycle through pages 2 to "end" to insert a second logo. I
can easily cycle through manually to insert the graphics, but I wish to
automate. Please review my comments to see where I wish to place the IF-THEN
statement:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/11/2005 by Todd E. Marlette
'
' GOTO TOP OF DOCUMENT -- THIS SECTION IS O.K.
Selection.HomeKey Unit:=wdStory
Application.DisplayAutoCompleteTips = True
' INSERT AUTOTEXT GRAPHIC CALLED LOGO -- THIS SECTION IS O.K.
NormalTemplate.AutoTextEntries("logo").Insert Where:=Selection.Range, _
RichText:=True
' IF "CURRENT PAGE" IS NOT THE "LAST PAGE" THEN GOTO TO NEXT PAGE AND
INSERT LOGO2
' HERE IS MY PROBLEM. HOW DO I WRITE THIS IF-THEN STATEMENT IN A WORD
MACRO?
' GOTO TOP OF NEXT PAGE -- THIS SECTION IS O.K.
Application.Browser.Next
Application.DisplayAutoCompleteTips = True
' INSERT AUTOTEXT GRAPHIC CALLED LOGO2 -- THIS SECTION IS O.K.
NormalTemplate.AutoTextEntries("logo2").Insert Where:=Selection.Range,
_
RichText:=True
End Sub
' THANK YOU !!!!!
insert a first logo on the first page of my Word document (which I can do by
assigning my graphic as autotext and then inserting from the Insert>Autotext
toolbar), and then cycle through pages 2 to "end" to insert a second logo. I
can easily cycle through manually to insert the graphics, but I wish to
automate. Please review my comments to see where I wish to place the IF-THEN
statement:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/11/2005 by Todd E. Marlette
'
' GOTO TOP OF DOCUMENT -- THIS SECTION IS O.K.
Selection.HomeKey Unit:=wdStory
Application.DisplayAutoCompleteTips = True
' INSERT AUTOTEXT GRAPHIC CALLED LOGO -- THIS SECTION IS O.K.
NormalTemplate.AutoTextEntries("logo").Insert Where:=Selection.Range, _
RichText:=True
' IF "CURRENT PAGE" IS NOT THE "LAST PAGE" THEN GOTO TO NEXT PAGE AND
INSERT LOGO2
' HERE IS MY PROBLEM. HOW DO I WRITE THIS IF-THEN STATEMENT IN A WORD
MACRO?
' GOTO TOP OF NEXT PAGE -- THIS SECTION IS O.K.
Application.Browser.Next
Application.DisplayAutoCompleteTips = True
' INSERT AUTOTEXT GRAPHIC CALLED LOGO2 -- THIS SECTION IS O.K.
NormalTemplate.AutoTextEntries("logo2").Insert Where:=Selection.Range,
_
RichText:=True
End Sub
' THANK YOU !!!!!