Thread: InputBox error
View Single Post
 
Old 05-13-2022, 11:14 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Naming the bookmarks with the current number is not a great idea so you could use three alternatives:
1. Generate a random string like Microsoft do
2. Generate a DateHourMinSecond string which starts with a letter (bookmarks can't start with a number)
3. Use the caption words in some way eg. SEaspect, NEaspect

Putting text into the callout balloon works like this
Code:
Sub TestCreateCaptionBubble()
  'Pastes a caption bubble and inserts reference to a photo number
  Dim aRng As Range, sTmp As String, aShp As Shape
  sTmp = "C:\Users\Philip Browne\AppData\Roaming\Microsoft\Document Building Blocks\1033\16\Building Blocks.dotx"
  Set aRng = Application.Templates(sTmp).BuildingBlockEntries("3").Insert(Where:=Selection.Range, RichText:=True)
  Debug.Print aRng.ShapeRange.Count
  Set aShp = aRng.ShapeRange(1)
  aShp.TextFrame.TextRange.Text = "Refer photo xx"
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote