![]() ' Returns FALSE if not existing, or if it's a folder ' Returns TRUE if the provided name points to an existing file. Public Function IsFile(ByVal path As String) As Boolean , LinkToFile:=msoFalse, SaveWithDocument:=True) ![]() InlineShapes.AddPicture(FileName:=filePath _ ForeColor.ObjectThemeColor = msoThemeColorText2 , Selection.Information(wdVerticalPositionRelativeToPage) + 1 _ , Selection.Information(wdHorizontalPositionRelativeToPage) _ Set myShape = (msoTextOrientationHorizontal _ ![]() ' plus 1 down in vertical direction to prevent automatic moving to the previous paragraph during 'inlining' ' Place the text-box shape at the current cursor position Selection.MoveDown Unit:=wdParagraph, Count:=1 ' Set cursor position where we want the text-box If IsEmpty(filePath) Or Not IsFile(filePath) Then Consider we create a text-box Shape with that contains an image Inline-Shape and store it into the myShape variable with VBA script, like below: Private Sub addImageButton_Click()ĭim doc As Document: Set doc = ThisDocument
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |