S
schmalen
hello
i have build an excel map
now i want to make an hyperlink in cell c5, if i click on cell c5, its
opening an document in word.
now i want that there is an possibility that if i click on c5 that comes an
small text in my word dokument like "good morning"
in a special area of this word document. also i want than in exce to manage
which position will be this text example from left border 5 from top 6
and script point 10
i have buils a smal vba scrip like here
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim objWord As Object, objDoc As Object
Set objWord = GetObject(, "Word.Application")
Set objDoc = objWord.ActiveDocument
objDoc.Sentences(1).InsertBefore "good morning "
End Sub
and this for the koordinates
Sub Absatz_Koord_Einfügen(Zeile$, Koord$, Optional Vorlage$ = "")
Dim Krd$(), Abschn&, Seite&, Oben#, Links#, Breite#, I%, Gr!, Größe!
Dim Shp As Shape
If Len(Vorlage$) Then FVorl$ = Vorlage$
Krd$ = Split(Koord$, ";")
Oben# = 0: Links# = 0: Breite# = 85.039: Größe! = 10!: Gr! = 10
For I% = 0 To UBound(Krd$)
Select Case Left$(Krd$(I%), 1)
Case "T": Oben# = CDbl(Mid$(Krd$(I%), 2)) / 2.54 * 72# 'in Punkt
Case "L": Links# = CDbl(Mid$(Krd$(I%), 2)) / 2.54 * 72# 'in Punkt
Case "B": Breite# = CDbl(Mid$(Krd$(I%), 2)) / 2.54 * 72# 'in Punkt
Case "G": Größe! = CDbl(Mid$(Krd$(I%), 2)) 'in Punkt
End Select
Next I%
' On Error Resume Next
With FApp.ActiveDocument
If Größe! < 8 Then Gr! = .Range.Font.Size Else Gr! = Größe!
With .Shapes.AddTextbox(msoTextOrientationHorizontal, Links#, Oben#,
Breite#, Gr!)
With .TextFrame
.MarginTop = 0
.MarginLeft = 0
.MarginBottom = 0
.MarginRight = 0
.TextRange.Font.Size = Gr!
.TextRange.Text = Zeile$
End With
.Line.Visible = msoFalse
End With
End With
End Sub
excuse me for my bad english
regards
Andreas
i have build an excel map
now i want to make an hyperlink in cell c5, if i click on cell c5, its
opening an document in word.
now i want that there is an possibility that if i click on c5 that comes an
small text in my word dokument like "good morning"
in a special area of this word document. also i want than in exce to manage
which position will be this text example from left border 5 from top 6
and script point 10
i have buils a smal vba scrip like here
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim objWord As Object, objDoc As Object
Set objWord = GetObject(, "Word.Application")
Set objDoc = objWord.ActiveDocument
objDoc.Sentences(1).InsertBefore "good morning "
End Sub
and this for the koordinates
Sub Absatz_Koord_Einfügen(Zeile$, Koord$, Optional Vorlage$ = "")
Dim Krd$(), Abschn&, Seite&, Oben#, Links#, Breite#, I%, Gr!, Größe!
Dim Shp As Shape
If Len(Vorlage$) Then FVorl$ = Vorlage$
Krd$ = Split(Koord$, ";")
Oben# = 0: Links# = 0: Breite# = 85.039: Größe! = 10!: Gr! = 10
For I% = 0 To UBound(Krd$)
Select Case Left$(Krd$(I%), 1)
Case "T": Oben# = CDbl(Mid$(Krd$(I%), 2)) / 2.54 * 72# 'in Punkt
Case "L": Links# = CDbl(Mid$(Krd$(I%), 2)) / 2.54 * 72# 'in Punkt
Case "B": Breite# = CDbl(Mid$(Krd$(I%), 2)) / 2.54 * 72# 'in Punkt
Case "G": Größe! = CDbl(Mid$(Krd$(I%), 2)) 'in Punkt
End Select
Next I%
' On Error Resume Next
With FApp.ActiveDocument
If Größe! < 8 Then Gr! = .Range.Font.Size Else Gr! = Größe!
With .Shapes.AddTextbox(msoTextOrientationHorizontal, Links#, Oben#,
Breite#, Gr!)
With .TextFrame
.MarginTop = 0
.MarginLeft = 0
.MarginBottom = 0
.MarginRight = 0
.TextRange.Font.Size = Gr!
.TextRange.Text = Zeile$
End With
.Line.Visible = msoFalse
End With
End With
End Sub
excuse me for my bad english
regards
Andreas